| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rasa.Ext.Slate.Internal.Attributes
- convertStyle :: Style -> Attr
- convertFlair :: Flair -> MaybeDefault Style
- convertColor :: Color -> MaybeDefault Color
- reset :: Image
- newtype AttrMonoid = AttrMonoid {}
- applyAttrs :: RenderInfo -> Image
- textAndStylesToImage :: [(Coord, Attr)] -> [YiString] -> Image
- attrLine :: [(Coord, Attr)] -> YiString -> Image
- pairLines :: [(Coord, b)] -> [a] -> [([(Coord, b)], a)]
- decrRow :: [(Coord, a)] -> [(Coord, a)]
- decrCol :: Int -> [(Coord, a)] -> [(Coord, a)]
- plainText :: YiString -> Image
Documentation
convertStyle :: Style -> Attr Source #
Convert style from Rasa.Ext.Style into Attrs
convertFlair :: Flair -> MaybeDefault Style Source #
Convert flair from Rasa.Ext.Style into Styles
convertColor :: Color -> MaybeDefault Color Source #
Convert colors from Rasa.Ext.Style into Colors
newtype AttrMonoid Source #
A newtype to define a (not necessarily law abiding) Monoid for Attr which acts as we like.
Constructors
| AttrMonoid | |
Instances
| Monoid AttrMonoid Source # | We want |
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.