Turn a text into a plain chunk, without any styling
Modulesafe-coloured-text-0.3.0.2Haskell2010
Text.Colour
Safe Coloured Text
This module is responsible for defining, building, and rendering coloured text.
The text to be coloured is Text, but the rendered text, while technically still (probably) valid Utf8, will be a ByteString builder.
- 3 types
- 48 values
- Packagesafe-coloured-text-0.3.0.2
- Exports51
- LanguageHaskell2010
- LicenceMIT
- SourceColour.hs
Building chunks
2 declarationsConstructors
Instances6Eq, Show, IsString, Generic, Validity, Rep
Eq ChunkDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkShow ChunkDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkIsString ChunkDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkGeneric ChunkDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkValidity ChunkDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Chunktype Rep Chunk = D1 ('MetaDataDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Chunk"Chunk"
"Text.Colour.Chunk"
"safe-coloured-text-0.3.0.2-2uitOnCY80jBmbI1tawE6k"
'False) (C1 ('MetaCons"Chunk"
'PrefixI 'True) ((S1 ('MetaSel ('Just"chunkText"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just"chunkItalic"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just"chunkConsoleIntensity"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ConsoleIntensity)))) :*: ((S1 ('MetaSel ('Just"chunkUnderlining"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Underlining)) :*: S1 ('MetaSel ('Just"chunkBlinking"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Blinking))) :*: (S1 ('MetaSel ('Just"chunkForeground"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Colour)) :*: S1 ('MetaSel ('Just"chunkBackground"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Colour))))))
Styling
Setting colour
Setting non-colour attributes
Colours
Constructors
Instances5Eq, Show, Generic, Validity, Rep
Eq ColourDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkShow ColourDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkGeneric ColourDefined in safe-coloured-text-0.3.0.2 · Text.Colour.ChunkValidity ColourDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Chunktype Rep Colour = D1 ('MetaDataDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Chunk"Colour"
"Text.Colour.Chunk"
"safe-coloured-text-0.3.0.2-2uitOnCY80jBmbI1tawE6k"
'False) (C1 ('MetaCons"Colour8"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ColourIntensity) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TerminalColour)) :+: (C1 ('MetaCons"Colour8Bit"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8)) :+: C1 ('MetaCons"Colour24Bit"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8)))))
8-colour
Dull
Bright
8-bit
Alias for colour256, bloody americans...
Bulid an 8-bit RGB Colour
This will not be rendered unless With8BitColours is used.
24-bit
Alias for colourRGB, bloody americans...
Bulid a 24-bit RGB Colour
This will not be rendered unless With24BitColours is used.
Rendering
0 declarationsComposing chunks
Render lines of chunks.
This puts newlines ("n") at the end of every list of chunks.
Render lines of chunks.
This puts newlines (" ") inbetween the list of chunks.
Rendering chunks to strict bytestring in UTF8
Render chunks directly to a UTF8-encoded Bytestring.
Render a chunk directly to a UTF8-encoded Bytestring.
Rendering chunks to lazy bytestring builders in UTF8
Render chunks to a UTF8-encoded ByteString Bytestring.Builder.
Render a chunk directly to a UTF8-encoded Bytestring Builder.
Rendering chunks to strict Text
Render chunks directly to strict Text.
Render a chunk directly to strict Text.
Rendering chunks to lazy text
Render chunks directly to lazy Text.
Render a chunk directly to strict Text.
Rendering chunks to lazy text builder
IO
1 declarationConstructors
WithoutColoursNo colours
With8ColoursOnly 8 colours
With8BitColoursOnly 8-bit colours
With24BitColoursAll 24-bit colours
Instances5Eq, Ord, Show, Generic, Rep
Eq TerminalCapabilitiesDefined in safe-coloured-text-0.3.0.2 · Text.Colour.CapabilitiesOrd TerminalCapabilitiesDefined in safe-coloured-text-0.3.0.2 · Text.Colour.CapabilitiesShow TerminalCapabilitiesDefined in safe-coloured-text-0.3.0.2 · Text.Colour.CapabilitiesGeneric TerminalCapabilitiesDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Capabilitiestype Rep TerminalCapabilities = D1 ('MetaDataDefined in safe-coloured-text-0.3.0.2 · Text.Colour.Capabilities"TerminalCapabilities"
"Text.Colour.Capabilities"
"safe-coloured-text-0.3.0.2-2uitOnCY80jBmbI1tawE6k"
'False) ((C1 ('MetaCons"WithoutColours"
'PrefixI 'False) U1 :+: C1 ('MetaCons"With8Colours"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"With8BitColours"
'PrefixI 'False) U1 :+: C1 ('MetaCons"With24BitColours"
'PrefixI 'False) U1))
Outputting chunks directly
Print a list of chunks to stdout with given TerminalCapabilities.
Print a list of chunks to stdout with given TerminalCapabilities in an encoding according to the system's locale.
Print a list of chunks to the given Handle with given TerminalCapabilities.
Print a list of chunks to the given Handle with given TerminalCapabilities in an encoding according to the system's locale.