rasa-ext-slate-0.1.8: Rasa extension for rendering to terminal with vty

Safe HaskellNone
LanguageHaskell2010

Rasa.Ext.Slate.Internal.Attributes

Synopsis

Documentation

convertStyle :: Style -> Attr Source #

Convert style from Rasa.Ext.Style into Attrs

reset :: Image Source #

helper to reset to default attributes

newtype AttrMonoid Source #

A newtype to define a (not necessarily law abiding) Monoid for Attr which acts as we like.

Constructors

AttrMonoid 

Fields

applyAttrs :: RenderInfo -> Image Source #

Apply a list of styles to the given text, resulting in a Image.

textAndStylesToImage :: [(Coord, Attr)] -> [YiString] -> Image Source #

Makes and image from text and styles

attrLine :: [(Coord, Attr)] -> YiString -> Image Source #

Applies the list of attrs to the line and returns a Image. It assumes that the list contains only Coords on the same line (i.e. row == 0)

Should be able to clean this up and provide better guarantees if I do a scan over attrs and get each successive mappend of them, then do T.splitAt for each offset, then apply the attr for each section at the begining of each of T.lines within each group. Ugly I know.

pairLines :: [(Coord, b)] -> [a] -> [([(Coord, b)], a)] Source #

Pairs up lines with their styles.

decrRow :: [(Coord, a)] -> [(Coord, a)] Source #

Decrements the row of all future attrs' location

decrCol :: Int -> [(Coord, a)] -> [(Coord, a)] Source #

Decrements the column of all future attrs' location by the given amount

plainText :: YiString -> Image Source #

Creates a text image without any new attributes.