hscolour-1.25: Colourise Haskell code.

Safe Haskell | Safe-Inferred
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 Source #

Colours supported by ANSI codes.

Constructors

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

#### Instances

Instances details

Enum Colour Source # |

Instance details

Defined in Language.Haskell.HsColour.ColourHighlight

Methods

succ :: Colour -> Colour Source #

pred :: Colour -> Colour Source #

toEnum :: Int -> Colour Source #

fromEnum :: Colour -> Int Source #

enumFrom :: Colour -> [Colour] Source #

enumFromThen :: Colour -> Colour -> [Colour] Source #

enumFromTo :: Colour -> Colour -> [Colour] Source #

enumFromThenTo :: Colour -> Colour -> Colour -> [Colour] Source #

Read Colour Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods readsPrec :: Int -> ReadS Colour Source # readList :: ReadS [Colour] Source # readPrec :: ReadPrec Colour Source # readListPrec :: ReadPrec [Colour] Source #
Show Colour Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods showsPrec :: Int -> Colour -> ShowS Source # show :: Colour -> String Source # showList :: [Colour] -> ShowS Source #
Eq Colour Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods (==) :: Colour -> Colour -> Bool Source # (/=) :: Colour -> Colour -> Bool Source #

data Highlight Source #

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

Instances details

Enum Highlight Source # |

Instance details

Defined in Language.Haskell.HsColour.ANSI

Methods

succ :: Highlight -> Highlight Source #

pred :: Highlight -> Highlight Source #

toEnum :: Int -> Highlight Source #

fromEnum :: Highlight -> Int Source #

enumFrom :: Highlight -> [Highlight] Source #

enumFromThen :: Highlight -> Highlight -> [Highlight] Source #

enumFromTo :: Highlight -> Highlight -> [Highlight] Source #

enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight] Source #

Read Highlight Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods readsPrec :: Int -> ReadS Highlight Source # readList :: ReadS [Highlight] Source # readPrec :: ReadPrec Highlight Source # readListPrec :: ReadPrec [Highlight] Source #
Show Highlight Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods showsPrec :: Int -> Highlight -> ShowS Source # show :: Highlight -> String Source # showList :: [Highlight] -> ShowS Source #
Eq Highlight Source # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods (==) :: Highlight -> Highlight -> Bool Source # (/=) :: Highlight -> Highlight -> Bool Source #

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

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 Source #

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 Source #

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

projectToBasicColour8 :: Colour -> Colour Source #

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 Source #

Lift `projectToBasicColour8` to `Highlight`s