| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rainbow.Types
Description
All the main types in Rainbow. Using this module you can specify
that you want different formatting for 8- and 256-color terminals.
Many of the names in this module conflict with the names in
Rainbow, so it's probably best to import this module
qualified.
Synopsis
- newtype Color a = Color (Maybe a)
- data Enum8
- enum8toWord8 :: Enum8 -> Word8
- black :: Enum8
- red :: Enum8
- green :: Enum8
- yellow :: Enum8
- blue :: Enum8
- magenta :: Enum8
- cyan :: Enum8
- white :: Enum8
- grey :: Word8
- brightRed :: Word8
- brightGreen :: Word8
- brightYellow :: Word8
- brightBlue :: Word8
- brightMagenta :: Word8
- brightCyan :: Word8
- brightWhite :: Word8
- data Format = Format {}
- strikeout :: Functor f => (Bool -> f Bool) -> Format -> f Format
- invisible :: Functor f => (Bool -> f Bool) -> Format -> f Format
- inverse :: Functor f => (Bool -> f Bool) -> Format -> f Format
- blink :: Functor f => (Bool -> f Bool) -> Format -> f Format
- underline :: Functor f => (Bool -> f Bool) -> Format -> f Format
- italic :: Functor f => (Bool -> f Bool) -> Format -> f Format
- faint :: Functor f => (Bool -> f Bool) -> Format -> f Format
- bold :: Functor f => (Bool -> f Bool) -> Format -> f Format
- data Style a = Style {}
- format :: Functor f => (Format -> f Format) -> Style a -> f (Style a)
- back :: Functor f => (Color a -> f (Color a)) -> Style a -> f (Style a)
- fore :: Functor f => (Color a -> f (Color a)) -> Style a -> f (Style a)
- data Scheme = Scheme {}
- style256 :: Functor f => (Style Word8 -> f (Style Word8)) -> Scheme -> f Scheme
- style8 :: Functor f => (Style Enum8 -> f (Style Enum8)) -> Scheme -> f Scheme
- data Chunk a = Chunk {}
- chunk :: a -> Chunk a
- yarn :: Functor f => (t -> f a) -> Chunk t -> f (Chunk a)
- scheme :: Functor f => (Scheme -> f Scheme) -> Chunk a -> f (Chunk a)
- data Radiant = Radiant {}
- color256 :: Functor f => (Color Word8 -> f (Color Word8)) -> Radiant -> f Radiant
- color8 :: Functor f => (Color Enum8 -> f (Color Enum8)) -> Radiant -> f Radiant
Documentation
A color; a Nothing value means that the terminal's default
color is used. The type of the Maybe generally will be an
Enum8 to represent one of 8 colors, or a Word8 to represent one
of 256 colors.
Instances
| Functor Color # | |
| Foldable Color # | |
Defined in Rainbow.Types Methods fold :: Monoid m => Color m -> m # foldMap :: Monoid m => (a -> m) -> Color a -> m # foldr :: (a -> b -> b) -> b -> Color a -> b # foldr' :: (a -> b -> b) -> b -> Color a -> b # foldl :: (b -> a -> b) -> b -> Color a -> b # foldl' :: (b -> a -> b) -> b -> Color a -> b # foldr1 :: (a -> a -> a) -> Color a -> a # foldl1 :: (a -> a -> a) -> Color a -> a # elem :: Eq a => a -> Color a -> Bool # maximum :: Ord a => Color a -> a # minimum :: Ord a => Color a -> a # | |
| Traversable Color # | |
| Eq a => Eq (Color a) # | |
| Ord a => Ord (Color a) # | |
| Show a => Show (Color a) # | |
| Generic (Color a) # | |
| Semigroup (Color a) # | |
| Monoid (Color a) # | Takes the last non-Nothing Color. |
| type Rep (Color a) # | |
Defined in Rainbow.Types | |
A simple enumeration for eight values. Represents eight colors.
Instances
| Bounded Enum8 # | |
| Enum Enum8 # | |
| Eq Enum8 # | |
| Ord Enum8 # | |
| Show Enum8 # | |
| Generic Enum8 # | |
| type Rep Enum8 # | |
Defined in Rainbow.Types type Rep Enum8 = D1 (MetaData "Enum8" "Rainbow.Types" "rainbow-0.30.0.2-EW8R4gDMzWfLhAFAzHdCZH" False) (((C1 (MetaCons "E0" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "E1" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "E2" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "E3" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "E4" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "E5" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "E6" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "E7" PrefixI False) (U1 :: * -> *)))) | |
enum8toWord8 :: Enum8 -> Word8 #
brightGreen :: Word8 #
brightYellow :: Word8 #
brightBlue :: Word8 #
brightMagenta :: Word8 #
brightCyan :: Word8 #
brightWhite :: Word8 #
Text formatting such as bold, italic, etc.
Constructors
| Format | |
Instances
The foreground and background color, and the Format. This
represents all colors and formatting attributes for either an 8- or
256-color terminal.
Instances
| Functor Style # | |
| Foldable Style # | |
Defined in Rainbow.Types Methods fold :: Monoid m => Style m -> m # foldMap :: Monoid m => (a -> m) -> Style a -> m # foldr :: (a -> b -> b) -> b -> Style a -> b # foldr' :: (a -> b -> b) -> b -> Style a -> b # foldl :: (b -> a -> b) -> b -> Style a -> b # foldl' :: (b -> a -> b) -> b -> Style a -> b # foldr1 :: (a -> a -> a) -> Style a -> a # foldl1 :: (a -> a -> a) -> Style a -> a # elem :: Eq a => a -> Style a -> Bool # maximum :: Ord a => Style a -> a # minimum :: Ord a => Style a -> a # | |
| Traversable Style # | |
| Eq a => Eq (Style a) # | |
| Ord a => Ord (Style a) # | |
| Show a => Show (Style a) # | |
| Generic (Style a) # | |
| Semigroup (Style a) # | |
| Monoid (Style a) # | |
| type Rep (Style a) # | |
Defined in Rainbow.Types type Rep (Style a) = D1 (MetaData "Style" "Rainbow.Types" "rainbow-0.30.0.2-EW8R4gDMzWfLhAFAzHdCZH" False) (C1 (MetaCons "Style" PrefixI True) (S1 (MetaSel (Just "_fore") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Color a)) :*: (S1 (MetaSel (Just "_back") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Color a)) :*: S1 (MetaSel (Just "_format") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Format)))) | |
Holds the Style for both 8- and 256-color terminals.
Instances
| Eq Scheme # | |
| Ord Scheme # | |
| Show Scheme # | |
| Generic Scheme # | |
| Semigroup Scheme # | |
| Monoid Scheme # | |
| type Rep Scheme # | |
Defined in Rainbow.Types type Rep Scheme = D1 (MetaData "Scheme" "Rainbow.Types" "rainbow-0.30.0.2-EW8R4gDMzWfLhAFAzHdCZH" False) (C1 (MetaCons "Scheme" PrefixI True) (S1 (MetaSel (Just "_style8") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Style Enum8)) :*: S1 (MetaSel (Just "_style256") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Style Word8)))) | |
A chunk is some textual data coupled with a description of what color the text is, attributes like whether it is bold or underlined, etc. The chunk knows what foreground and background colors and what attributes to use for both an 8 color terminal and a 256 color terminal.
Instances
| Functor Chunk # | |
| Foldable Chunk # | |
Defined in Rainbow.Types Methods fold :: Monoid m => Chunk m -> m # foldMap :: Monoid m => (a -> m) -> Chunk a -> m # foldr :: (a -> b -> b) -> b -> Chunk a -> b # foldr' :: (a -> b -> b) -> b -> Chunk a -> b # foldl :: (b -> a -> b) -> b -> Chunk a -> b # foldl' :: (b -> a -> b) -> b -> Chunk a -> b # foldr1 :: (a -> a -> a) -> Chunk a -> a # foldl1 :: (a -> a -> a) -> Chunk a -> a # elem :: Eq a => a -> Chunk a -> Bool # maximum :: Ord a => Chunk a -> a # minimum :: Ord a => Chunk a -> a # | |
| Traversable Chunk # | |
| Eq a => Eq (Chunk a) # | |
| Ord a => Ord (Chunk a) # | |
| Show a => Show (Chunk a) # | |
| Generic (Chunk a) # | |
| Semigroup a => Semigroup (Chunk a) # | |
| Monoid a => Monoid (Chunk a) # | Uses the underlying |
| type Rep (Chunk a) # | |
Defined in Rainbow.Types type Rep (Chunk a) = D1 (MetaData "Chunk" "Rainbow.Types" "rainbow-0.30.0.2-EW8R4gDMzWfLhAFAzHdCZH" False) (C1 (MetaCons "Chunk" PrefixI True) (S1 (MetaSel (Just "_scheme") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Scheme) :*: S1 (MetaSel (Just "_yarn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) | |
Stores colors that may affect 8-color terminals, 256-color terminals, both, or neither.
Instances
| Eq Radiant # | |
| Ord Radiant # | |
| Show Radiant # | |
| Generic Radiant # | |
| Semigroup Radiant # | |
| Monoid Radiant # | Uses the underlying |
| type Rep Radiant # | |
Defined in Rainbow.Types type Rep Radiant = D1 (MetaData "Radiant" "Rainbow.Types" "rainbow-0.30.0.2-EW8R4gDMzWfLhAFAzHdCZH" False) (C1 (MetaCons "Radiant" PrefixI True) (S1 (MetaSel (Just "_color8") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Color Enum8)) :*: S1 (MetaSel (Just "_color256") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Color Word8)))) | |