($con2tag_Highlight) :: Highlight -> Int#module Language.Haskell.HsColour.ColourHighlight
( Colour(..)
, Highlight(..)
, base256, unbase
, rgb24bit_to_xterm256
, projectToBasicColour8
, hlProjectToBasicColour8
) where
import Data.Word
data Colour = Black :: ColourBlack | Red :: ColourRed | Green :: ColourGreen | Yellow :: ColourYellow | Blue :: ColourBlue | Magenta :: ColourMagenta | Cyan :: ColourCyan | White :: ColourWhite | Rgb :: Word8 -> Word8 -> Word8 -> ColourRgb Word8 Word8 Word8
deriving (D:Eq :: (a -> a -> Bool) -> (a -> a -> Bool) -> T:Eq aEq,D:Show ::
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> T:Show aShow,D:Read ::
(Int -> ReadS a)
-> ReadS [a]
-> ReadPrec a
-> ReadPrec [a]
-> T:Read aRead)
base256 :: Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> r
base256 ::
Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> rbase256 kont :: Word8 -> Word8 -> Word8 -> rkont x :: intx =
let
(r :: intr,gb :: intgb) = divMod :: Integral a => a -> a -> (a, a)divMod x :: Intx 256
(g :: intg,b :: intb) = divMod :: Integral a => a -> a -> (a, a)divMod gb :: intgb 256
fi :: int -> Word8fi = fromIntegral :: (Integral a, Num b) => a -> bfromIntegral
in
kont :: Word8 -> Word8 -> Word8 -> rkont (fi :: int -> Word8fi r :: Word8r) (fi :: int -> Word8fi g :: Word8g) (fi :: int -> Word8fi b :: Word8b)
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> intunbase base :: intbase r :: Word8r g :: Word8g b :: Word8b = (fi :: int -> Word8fi r :: Word8r(*) :: Num a => a -> a -> a*base :: intbase(+) :: Num a => a -> a -> a+fi :: int -> Word8fi g :: Word8g)(*) :: Num a => a -> a -> a*base :: intbase(+) :: Num a => a -> a -> a+fi :: int -> Word8fi b :: Word8b
where fi :: Word8 -> intfi = fromIntegral :: (Integral a, Num b) => a -> bfromIntegral
rgb24bit_to_xterm256 :: (Integral t) => Word8 -> Word8 -> Word8 -> t
rgb24bit_to_xterm256 :: Integral t => Word8 -> Word8 -> Word8 -> trgb24bit_to_xterm256 r :: Word8r g :: Word8g b :: Word8b = let f :: Word8 -> Word8f = (div :: Integral a => a -> a -> a`div` 43)
in 16 (+) :: Num a => a -> a -> a+ unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> intunbase 6 (f :: Word8 -> Word8f r :: Word8r) (f :: Word8 -> Word8f g :: Word8g) (f :: Word8 -> Word8f b :: Word8b)
projectToBasicColour8 :: Colour -> Colour
projectToBasicColour8 :: Colour -> ColourprojectToBasicColour8 (Rgb r :: Word8r g :: Word8g b :: Word8b) = let f :: Word8 -> Word8f = (div :: Integral a => a -> a -> a`div` 128)
in toEnum :: Enum a => Int -> atoEnum ( unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> intunbase 2 (f :: Word8 -> Word8f r :: Word8r) (f :: Word8 -> Word8f g :: Word8g) (f :: Word8 -> Word8f b :: Word8b) )
projectToBasicColour8 x :: Colourx = x :: Intx
hlProjectToBasicColour8 :: Highlight -> Highlight
hlProjectToBasicColour8 :: Highlight -> HighlighthlProjectToBasicColour8 (Foreground c :: Colourc) = Foreground :: Colour -> HighlightForeground (projectToBasicColour8 :: Colour -> ColourprojectToBasicColour8 c :: Colourc)
hlProjectToBasicColour8 (Background c :: Colourc) = Background :: Colour -> HighlightBackground (projectToBasicColour8 :: Colour -> ColourprojectToBasicColour8 c :: Colourc)
hlProjectToBasicColour8 h :: Highlighth = h :: Highlighth
instance D:Enum ::
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> T:Enum aEnum Colour where
toEnum 0 = Black :: ColourBlack
toEnum 1 = Red :: ColourRed
toEnum 2 = Green :: ColourGreen
toEnum 3 = Yellow :: ColourYellow
toEnum 4 = Blue :: ColourBlue
toEnum 5 = Magenta :: ColourMagenta
toEnum 6 = Cyan :: ColourCyan
toEnum 7 = White :: ColourWhite
toEnum x :: Intx = base256 ::
Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> rbase256 Rgb :: Word8 -> Word8 -> Word8 -> ColourRgb (x :: Intx(-) :: Num a => a -> a -> a8)
fromEnum Black = 0
fromEnum Red = 1
fromEnum Green = 2
fromEnum Yellow = 3
fromEnum Blue = 4
fromEnum Magenta = 5
fromEnum Cyan = 6
fromEnum White = 7
fromEnum (Rgb r :: Word8r g :: Word8g b :: Word8b) = 8 (+) :: Num a => a -> a -> a+ unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> intunbase 256 r :: Word8r g :: Word8g b :: Word8b
data Highlight =
Normal :: HighlightNormal
| Bold :: HighlightBold
| Dim :: HighlightDim
| Underscore :: HighlightUnderscore
| Blink :: HighlightBlink
| ReverseVideo :: HighlightReverseVideo
| Concealed :: HighlightConcealed
| Foreground :: Colour -> HighlightForeground Colour
| Background :: Colour -> HighlightBackground Colour
| Italic :: HighlightItalic
deriving (D:Eq :: (a -> a -> Bool) -> (a -> a -> Bool) -> T:Eq aEq,D:Show ::
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> T:Show aShow,D:Read ::
(Int -> ReadS a)
-> ReadS [a]
-> ReadPrec a
-> ReadPrec [a]
-> T:Read aRead)