Language.Haskell.HsColour.ColourHighlight

hscolour-1.24: Colourise Haskell code.

Safe Haskell | Safe
Language | Haskell98

Language.Haskell.HsColour.ColourHighlight

Synopsis

- data Colour
  - = Black
  - | Red
  - | Green
  - | Yellow
  - | Blue
  - | Magenta
  - | Cyan
  - | White
  - | Rgb Word8 Word8 Word8
- data Highlight
  - = Normal
  - | Bold
  - | Dim
  - | Underscore
  - | Blink
  - | ReverseVideo
  - | Concealed
  - | Foreground Colour
  - | Background Colour
  - | Italic
- base256 :: Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> r
- unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int
- rgb24bit_to_xterm256 :: Integral t => Word8 -> Word8 -> Word8 -> t
- projectToBasicColour8 :: Colour -> Colour
- hlProjectToBasicColour8 :: Highlight -> Highlight

# Documentation

data Colour #

Colours supported by ANSI codes.

Constructors

Black |
Red |
Green |
Yellow |
Blue |
Magenta |
Cyan |
White |
Rgb Word8 Word8 Word8 |

Instances

Enum Colour # |
Methods succ :: Colour -> Colour # pred :: Colour -> Colour # toEnum :: Int -> Colour # fromEnum :: Colour -> Int # enumFrom :: Colour -> [Colour] # enumFromThen :: Colour -> Colour -> [Colour] # enumFromTo :: Colour -> Colour -> [Colour] # enumFromThenTo :: Colour -> Colour -> Colour -> [Colour] #
Eq Colour # |
Methods (==) :: Colour -> Colour -> Bool # (/=) :: Colour -> Colour -> Bool #
Read Colour # |
Methods readsPrec :: Int -> ReadS Colour # readList :: ReadS [Colour] # readPrec :: ReadPrec Colour # readListPrec :: ReadPrec [Colour] #
Show Colour # |
Methods showsPrec :: Int -> Colour -> ShowS # show :: Colour -> String # showList :: [Colour] -> ShowS #

data Highlight #

Types of highlighting supported by ANSI codes (and some extra styles).

Constructors

Normal |
Bold |
Dim |
Underscore |
Blink |
ReverseVideo |
Concealed |
Foreground Colour |
Background Colour |
Italic |

Instances

Eq Highlight # |
Methods (==) :: Highlight -> Highlight -> Bool # (/=) :: Highlight -> Highlight -> Bool #
Read Highlight # |
Methods readsPrec :: Int -> ReadS Highlight # readList :: ReadS [Highlight] # readPrec :: ReadPrec Highlight # readListPrec :: ReadPrec [Highlight] #
Show Highlight # |
Methods showsPrec :: Int -> Highlight -> ShowS # show :: Highlight -> String # showList :: [Highlight] -> ShowS #

base256 :: Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> r #

Convert an integer in the range [0,2^24-1] to its base 256-triplet, passing the result to the given continuation (avoid unnecessary tupleism).

unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int #

Convert a three-digit numeral in the given (as arg 1) base to its integer value.

rgb24bit_to_xterm256 :: Integral t => Word8 -> Word8 -> Word8 -> t #

Approximate a 24-bit Rgb colour with a colour in the xterm256 6x6x6 colour cube, returning its index.

projectToBasicColour8 :: Colour -> Colour #

Ap"proxi"mate a 24-bit Rgb colour with an ANSI8 colour. Will leave other colours unchanged and will never return an `Rgb` constructor value.

hlProjectToBasicColour8 :: Highlight -> Highlight #

Lift `projectToBasicColour8` to `Highlight`s