module Skylighting.Styles (
    parseTheme
  , kate
  , breezeDark
  , pygments
  , espresso
  , tango
  , haddock
  , monochrome
  , zenburn) where

import Data.Aeson (eitherDecode)
import Data.ByteString.Lazy (ByteString)
import qualified Data.Map as Map
import Skylighting.Types

-- | Parse a KDE theme JSON document into a skylighting Style.
parseTheme :: ByteString -> Either String Style
parseTheme :: ByteString -> Either String Style
parseTheme = ByteString -> Either String Style
forall a. FromJSON a => ByteString -> Either String a
eitherDecode

color :: Int -> Maybe Color
color :: Int -> Maybe Color
color = Int -> Maybe Color
forall a. ToColor a => a -> Maybe Color
toColor

-- | Style based on kate's default colors.
kate :: Style
kate :: Style
kate = Style{
      tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
        [ ( TokenType
KeywordTok, TokenStyle
defStyle { tokenColor = Just (RGB 31 28 27), tokenBold = True })
        , ( TokenType
DataTypeTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 87 174) })
        , ( TokenType
DecValTok, TokenStyle
defStyle { tokenColor = Just (RGB 176 128 0) })
        , ( TokenType
BaseNTok, TokenStyle
defStyle { tokenColor = Just (RGB 176 128 0) })
        , ( TokenType
FloatTok, TokenStyle
defStyle { tokenColor = Just (RGB 176 128 0) })
        , ( TokenType
ConstantTok, TokenStyle
defStyle { tokenColor = Just (RGB 170 85 0) })
        , ( TokenType
CharTok, TokenStyle
defStyle { tokenColor = Just (RGB 146 76 157) })
        , ( TokenType
SpecialCharTok, TokenStyle
defStyle { tokenColor = Just (RGB 61 174 233) })
        , ( TokenType
StringTok, TokenStyle
defStyle { tokenColor = Just (RGB 191 3 3) })
        , ( TokenType
VerbatimStringTok, TokenStyle
defStyle { tokenColor = Just (RGB 191 3 3) })
        , ( TokenType
SpecialStringTok, TokenStyle
defStyle { tokenColor = Just (RGB 255 85 0) })
        , ( TokenType
ImportTok, TokenStyle
defStyle { tokenColor = Just (RGB 255 85 0) })
        , ( TokenType
CommentTok, TokenStyle
defStyle { tokenColor = Just (RGB 137 136 135) })
        , ( TokenType
DocumentationTok, TokenStyle
defStyle { tokenColor = Just (RGB 96 120 128) })
        , ( TokenType
AnnotationTok, TokenStyle
defStyle { tokenColor = Just (RGB 202 96 202) })
        , ( TokenType
CommentVarTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 149 255) })
        , ( TokenType
OtherTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 110 40) })
        , ( TokenType
FunctionTok, TokenStyle
defStyle { tokenColor = Just (RGB 100 74 155) })
        , ( TokenType
VariableTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 87 174) })
        , ( TokenType
ControlFlowTok, TokenStyle
defStyle { tokenColor = Just (RGB 31 28 27), tokenBold = True })
        , ( TokenType
OperatorTok, TokenStyle
defStyle { tokenColor = Just (RGB 31 28 27) })
        , ( TokenType
BuiltInTok, TokenStyle
defStyle { tokenColor = Just (RGB 100 74 155), tokenBold = True })
        , ( TokenType
ExtensionTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 149 255), tokenBold = True })
        , ( TokenType
PreprocessorTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 110 40) })
        , ( TokenType
AttributeTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 87 174) })
        , ( TokenType
RegionMarkerTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 87 174), tokenBackground = Just (RGB 224 233 248)} )
        , ( TokenType
InformationTok, TokenStyle
defStyle { tokenColor = Just (RGB 176 128 0) })
        , ( TokenType
WarningTok, TokenStyle
defStyle { tokenColor = Just (RGB 191 3 3) })
        , ( TokenType
AlertTok, TokenStyle
defStyle { tokenColor = Just (RGB 191 3 3), tokenBackground = Just (RGB 247 230 230), tokenBold = True })
        , ( TokenType
ErrorTok, TokenStyle
defStyle { tokenColor = Just (RGB 191 3 3), tokenUnderline = True })
        , ( TokenType
NormalTok, TokenStyle
defStyle { tokenColor = Just (RGB 31 28 27) })
        ]
    , defaultColor :: Maybe Color
defaultColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
31 Word8
28 Word8
27)
    , backgroundColor :: Maybe Color
backgroundColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
255 Word8
255 Word8
255)
    , lineNumberColor :: Maybe Color
lineNumberColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
160 Word8
160 Word8
160)
    , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
255 Word8
255 Word8
255)
    }

-- | Style from the breeze-dark KDE syntax highlighting theme.
breezeDark :: Style
breezeDark :: Style
breezeDark = Style
    { tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
        [ ( TokenType
KeywordTok, TokenStyle
defStyle { tokenColor = Just (RGB 207 207 194), tokenBold = True })
        , ( TokenType
DataTypeTok, TokenStyle
defStyle { tokenColor = Just (RGB 41 128 185) })
        , ( TokenType
DecValTok, TokenStyle
defStyle { tokenColor = Just (RGB 246 116 0) })
        , ( TokenType
BaseNTok, TokenStyle
defStyle { tokenColor = Just (RGB 246 116 0) })
        , ( TokenType
FloatTok, TokenStyle
defStyle { tokenColor = Just (RGB 246 116 0) })
        , ( TokenType
ConstantTok, TokenStyle
defStyle { tokenColor = Just (RGB 39 174 174), tokenBold = True })
        , ( TokenType
CharTok, TokenStyle
defStyle { tokenColor = Just (RGB 61 174 233) })
        , ( TokenType
SpecialCharTok, TokenStyle
defStyle { tokenColor = Just (RGB 61 174 233) })
        , ( TokenType
StringTok, TokenStyle
defStyle { tokenColor = Just (RGB 244 79 79) })
        , ( TokenType
VerbatimStringTok, TokenStyle
defStyle { tokenColor = Just (RGB 218 68 83) })
        , ( TokenType
SpecialStringTok, TokenStyle
defStyle { tokenColor = Just (RGB 218 68 83) })
        , ( TokenType
ImportTok, TokenStyle
defStyle { tokenColor = Just (RGB 39 174 96) })
        , ( TokenType
CommentTok, TokenStyle
defStyle { tokenColor = Just (RGB 122 124 125) })
        , ( TokenType
DocumentationTok, TokenStyle
defStyle { tokenColor = Just (RGB 164 51 64) })
        , ( TokenType
AnnotationTok, TokenStyle
defStyle { tokenColor = Just (RGB 63 128 88) })
        , ( TokenType
CommentVarTok, TokenStyle
defStyle { tokenColor = Just (RGB 127 140 141) })
        , ( TokenType
OtherTok, TokenStyle
defStyle { tokenColor = Just (RGB 39 174 96) })
        , ( TokenType
FunctionTok, TokenStyle
defStyle { tokenColor = Just (RGB 142 68 173) })
        , ( TokenType
VariableTok, TokenStyle
defStyle { tokenColor = Just (RGB 39 174 174) })
        , ( TokenType
ControlFlowTok, TokenStyle
defStyle { tokenColor = Just (RGB 253 188 75), tokenBold = True })
        , ( TokenType
OperatorTok, TokenStyle
defStyle { tokenColor = Just (RGB 207 207 194) })
        , ( TokenType
BuiltInTok, TokenStyle
defStyle { tokenColor = Just (RGB 127 140 141) })
        , ( TokenType
ExtensionTok, TokenStyle
defStyle { tokenColor = Just (RGB 0 153 255), tokenBold = True })
        , ( TokenType
PreprocessorTok, TokenStyle
defStyle { tokenColor = Just (RGB 39 174 96) })
        , ( TokenType
AttributeTok, TokenStyle
defStyle { tokenColor = Just (RGB 41 128 185) })
        , ( TokenType
RegionMarkerTok, TokenStyle
defStyle { tokenColor = Just (RGB 41 128 185), tokenBackground = Just (RGB 21 48 66) })
        , ( TokenType
InformationTok, TokenStyle
defStyle { tokenColor = Just (RGB 196 91 0) })
        , ( TokenType
WarningTok, TokenStyle
defStyle { tokenColor = Just (RGB 218 68 83) })
        , ( TokenType
AlertTok, TokenStyle
defStyle { tokenColor = Just (RGB 149 218 76), tokenBackground = Just (RGB 77 31 36), tokenBold = True })
        , ( TokenType
ErrorTok, TokenStyle
defStyle { tokenColor = Just (RGB 218 68 83), tokenUnderline = True })
        , ( TokenType
NormalTok, TokenStyle
defStyle { tokenColor = Just (RGB 207 207 194) })
        ]
    , defaultColor :: Maybe Color
defaultColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
207 Word8
207 Word8
194)
    , backgroundColor :: Maybe Color
backgroundColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
35 Word8
38 Word8
41)
    , lineNumberColor :: Maybe Color
lineNumberColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
122 Word8
124 Word8
125)
    , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
35 Word8
38 Word8
41)
    }

-- | Style based on pygments's default colors.
pygments :: Style
pygments :: Style
pygments = Style{
    backgroundColor :: Maybe Color
backgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , defaultColor :: Maybe Color
defaultColor = Maybe Color
forall a. Maybe a
Nothing
  , lineNumberColor :: Maybe Color
lineNumberColor = Int -> Maybe Color
color Int
0xaaaaaa
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    [ (TokenType
KeywordTok, TokenStyle
defStyle{ tokenColor = color 0x007020, tokenBold = True })
    , (TokenType
DataTypeTok, TokenStyle
defStyle{ tokenColor = color 0x902000 })
    , (TokenType
DecValTok, TokenStyle
defStyle{ tokenColor = color 0x40a070 })
    , (TokenType
BaseNTok, TokenStyle
defStyle{ tokenColor = color 0x40a070 })
    , (TokenType
FloatTok, TokenStyle
defStyle{ tokenColor = color 0x40a070 })
    , (TokenType
CharTok, TokenStyle
defStyle{ tokenColor = color 0x4070a0 })
    , (TokenType
StringTok, TokenStyle
defStyle{ tokenColor = color 0x4070a0 })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenColor = color 0x60a0b0, tokenItalic = True })
    , (TokenType
OtherTok, TokenStyle
defStyle{ tokenColor = color 0x007020 })
    , (TokenType
AlertTok, TokenStyle
defStyle{ tokenColor = color 0xff0000, tokenBold = True })
    , (TokenType
FunctionTok, TokenStyle
defStyle{ tokenColor = color 0x06287e })
    , (TokenType
ErrorTok, TokenStyle
defStyle{ tokenColor = color 0xff0000, tokenBold = True })
    , (TokenType
WarningTok, TokenStyle
defStyle{ tokenColor = color 0x60a0b0, tokenItalic = True, tokenBold = True })
    , (TokenType
ConstantTok, TokenStyle
defStyle{ tokenColor = color 0x880000 })
    , (TokenType
SpecialCharTok, TokenStyle
defStyle{ tokenColor = color 0x4070a0 })
    , (TokenType
VerbatimStringTok, TokenStyle
defStyle{ tokenColor = color 0x4070a0 })
    , (TokenType
SpecialStringTok, TokenStyle
defStyle{ tokenColor = color 0xBB6688 })
    , (TokenType
ImportTok, TokenStyle
defStyle{ tokenColor = color 0x008000, tokenBold = True})
    , (TokenType
VariableTok, TokenStyle
defStyle{ tokenColor = color 0x19177C })
    , (TokenType
ControlFlowTok, TokenStyle
defStyle{ tokenColor = color 0x007020, tokenBold = True })
    , (TokenType
OperatorTok, TokenStyle
defStyle{ tokenColor = color 0x666666 })
    , (TokenType
BuiltInTok, TokenStyle
defStyle{ tokenColor = color 0x008000})
    , (TokenType
ExtensionTok, TokenStyle
defStyle)
    , (TokenType
PreprocessorTok, TokenStyle
defStyle{ tokenColor = color 0xBC7A00 })
    , (TokenType
AttributeTok, TokenStyle
defStyle{ tokenColor = color 0x7D9029 })
    , (TokenType
DocumentationTok, TokenStyle
defStyle{ tokenColor = color 0xBA2121, tokenItalic = True })
    , (TokenType
AnnotationTok, TokenStyle
defStyle{ tokenColor = color 0x60a0b0, tokenItalic = True, tokenBold = True })
    , (TokenType
CommentVarTok, TokenStyle
defStyle{ tokenColor = color 0x60a0b0, tokenItalic = True, tokenBold = True })
    , (TokenType
InformationTok, TokenStyle
defStyle{ tokenColor = color 0x60a0b0, tokenItalic = True, tokenBold = True })
    ]
  }


-- | Style based on pygments's tango colors.
tango :: Style
tango :: Style
tango = Style
  { tokenStyles :: Map TokenType TokenStyle
tokenStyles =
      [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
        [ ( TokenType
KeywordTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
32 Word8
74 Word8
135)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
DataTypeTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
32 Word8
74 Word8
135)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
DecValTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
0 Word8
0 Word8
207)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
BaseNTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
0 Word8
0 Word8
207)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
FloatTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
0 Word8
0 Word8
207)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
ConstantTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
CharTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
78 Word8
154 Word8
6)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
SpecialCharTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
206 Word8
92 Word8
0)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
StringTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
78 Word8
154 Word8
6)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
VerbatimStringTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
78 Word8
154 Word8
6)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
SpecialStringTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
78 Word8
154 Word8
6)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
ImportTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Maybe Color
forall a. Maybe a
Nothing
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
CommentTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
DocumentationTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
AnnotationTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
CommentVarTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
OtherTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
FunctionTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
32 Word8
74 Word8
135)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
VariableTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
0 Word8
0 Word8
0)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
ControlFlowTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
32 Word8
74 Word8
135)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
OperatorTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
206 Word8
92 Word8
0)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
ExtensionTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Maybe Color
forall a. Maybe a
Nothing
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
PreprocessorTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
AttributeTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
32 Word8
74 Word8
135)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
InformationTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
WarningTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
143 Word8
89 Word8
2)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
True
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
AlertTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
239 Word8
41 Word8
41)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
False
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        , ( TokenType
ErrorTok
          , TokenStyle
              { tokenColor :: Maybe Color
tokenColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
164 Word8
0 Word8
0)
              , tokenBackground :: Maybe Color
tokenBackground = Maybe Color
forall a. Maybe a
Nothing
              , tokenBold :: Bool
tokenBold = Bool
True
              , tokenItalic :: Bool
tokenItalic = Bool
False
              , tokenUnderline :: Bool
tokenUnderline = Bool
False
              }
          )
        ]
  , defaultColor :: Maybe Color
defaultColor = Maybe Color
forall a. Maybe a
Nothing
  , backgroundColor :: Maybe Color
backgroundColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
248 Word8
248 Word8
248)
  , lineNumberColor :: Maybe Color
lineNumberColor = Color -> Maybe Color
forall a. a -> Maybe a
Just (Word8 -> Word8 -> Word8 -> Color
RGB Word8
170 Word8
170 Word8
170)
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Maybe Color
forall a. Maybe a
Nothing
  }

-- | Style based on ultraviolet's espresso_libre.css (dark background).
espresso :: Style
espresso :: Style
espresso = Style{
    backgroundColor :: Maybe Color
backgroundColor = Int -> Maybe Color
color Int
0x2A211C
  , defaultColor :: Maybe Color
defaultColor = Int -> Maybe Color
color Int
0xBDAE9D
  , lineNumberColor :: Maybe Color
lineNumberColor = Int -> Maybe Color
color Int
0xBDAE9D
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Int -> Maybe Color
color Int
0x2A211C
  , tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    [ (TokenType
KeywordTok, TokenStyle
defStyle{ tokenColor = color 0x43A8ED, tokenBold = True })
    , (TokenType
DataTypeTok, TokenStyle
defStyle{ tokenUnderline = True })
    , (TokenType
DecValTok, TokenStyle
defStyle{ tokenColor = color 0x44AA43 })
    , (TokenType
BaseNTok, TokenStyle
defStyle{ tokenColor = color 0x44AA43 })
    , (TokenType
FloatTok, TokenStyle
defStyle{ tokenColor = color 0x44AA43 })
    , (TokenType
CharTok, TokenStyle
defStyle{ tokenColor = color 0x049B0A })
    , (TokenType
StringTok, TokenStyle
defStyle{ tokenColor = color 0x049B0A })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenColor = color 0x0066FF, tokenItalic = True })
    , (TokenType
AlertTok, TokenStyle
defStyle{ tokenColor = color 0xffff00 })
    , (TokenType
FunctionTok, TokenStyle
defStyle{ tokenColor = color 0xFF9358, tokenBold = True })
    , (TokenType
ErrorTok, TokenStyle
defStyle{ tokenColor = color 0xffff00, tokenBold = True })
    , (TokenType
WarningTok, TokenStyle
defStyle{ tokenColor = color 0xffff00, tokenBold = True })
    , (TokenType
ConstantTok, TokenStyle
defStyle)
    , (TokenType
SpecialCharTok, TokenStyle
defStyle{ tokenColor = color 0x049B0A })
    , (TokenType
VerbatimStringTok, TokenStyle
defStyle{ tokenColor = color 0x049B0A })
    , (TokenType
SpecialStringTok, TokenStyle
defStyle{ tokenColor = color 0x049B0A })
    , (TokenType
ImportTok, TokenStyle
defStyle)
    , (TokenType
VariableTok, TokenStyle
defStyle)
    , (TokenType
ControlFlowTok, TokenStyle
defStyle{ tokenColor = color 0x43A8ED, tokenBold = True })
    , (TokenType
OperatorTok, TokenStyle
defStyle)
    , (TokenType
BuiltInTok, TokenStyle
defStyle)
    , (TokenType
ExtensionTok, TokenStyle
defStyle)
    , (TokenType
PreprocessorTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
AttributeTok, TokenStyle
defStyle)
    , (TokenType
DocumentationTok, TokenStyle
defStyle{ tokenColor = color 0x0066FF, tokenItalic = True })
    , (TokenType
AnnotationTok, TokenStyle
defStyle{ tokenColor = color 0x0066FF, tokenItalic = True, tokenBold = True })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenColor = color 0x0066FF, tokenItalic = True, tokenBold = True })
    , (TokenType
InformationTok, TokenStyle
defStyle{ tokenColor = color 0x0066FF, tokenItalic = True, tokenBold = True })
    ]
  }

-- | Style based on haddock's source highlighting.
haddock :: Style
haddock :: Style
haddock = Style{
    backgroundColor :: Maybe Color
backgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , defaultColor :: Maybe Color
defaultColor = Maybe Color
forall a. Maybe a
Nothing
  , lineNumberColor :: Maybe Color
lineNumberColor = Int -> Maybe Color
color Int
0xaaaaaa
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    [ (TokenType
KeywordTok, TokenStyle
defStyle{ tokenColor = color 0x0000FF })
    , (TokenType
CharTok, TokenStyle
defStyle{ tokenColor = color 0x008080 })
    , (TokenType
StringTok, TokenStyle
defStyle{ tokenColor = color 0x008080 })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenColor = color 0x008000 })
    , (TokenType
OtherTok, TokenStyle
defStyle{ tokenColor = color 0xff4000 })
    , (TokenType
AlertTok, TokenStyle
defStyle{ tokenColor = color 0xff0000 })
    , (TokenType
ErrorTok, TokenStyle
defStyle{ tokenColor = color 0xff0000, tokenBold = True })
    , (TokenType
WarningTok, TokenStyle
defStyle{ tokenColor = color 0x008000, tokenBold = True })
    , (TokenType
ConstantTok, TokenStyle
defStyle)
    , (TokenType
SpecialCharTok, TokenStyle
defStyle{ tokenColor = color 0x008080 })
    , (TokenType
VerbatimStringTok, TokenStyle
defStyle{ tokenColor = color 0x008080 })
    , (TokenType
SpecialStringTok, TokenStyle
defStyle{ tokenColor = color 0x008080 })
    , (TokenType
ImportTok, TokenStyle
defStyle)
    , (TokenType
VariableTok, TokenStyle
defStyle)
    , (TokenType
ControlFlowTok, TokenStyle
defStyle{ tokenColor = color 0x0000FF })
    , (TokenType
OperatorTok, TokenStyle
defStyle)
    , (TokenType
BuiltInTok, TokenStyle
defStyle)
    , (TokenType
ExtensionTok, TokenStyle
defStyle)
    , (TokenType
PreprocessorTok, TokenStyle
defStyle{ tokenColor = color 0xff4000 })
    , (TokenType
DocumentationTok, TokenStyle
defStyle{ tokenColor = color 0x008000 })
    , (TokenType
AnnotationTok, TokenStyle
defStyle{ tokenColor = color 0x008000 })
    , (TokenType
CommentVarTok, TokenStyle
defStyle{ tokenColor = color 0x008000 })
    , (TokenType
AttributeTok, TokenStyle
defStyle)
    , (TokenType
InformationTok, TokenStyle
defStyle{ tokenColor = color 0x008000 })
    ]
  }

-- | Style with no colors.
monochrome :: Style
monochrome :: Style
monochrome = Style{
    backgroundColor :: Maybe Color
backgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , defaultColor :: Maybe Color
defaultColor = Maybe Color
forall a. Maybe a
Nothing
  , lineNumberColor :: Maybe Color
lineNumberColor = Maybe Color
forall a. Maybe a
Nothing
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    [ (TokenType
KeywordTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
DataTypeTok, TokenStyle
defStyle{ tokenUnderline = True })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenItalic = True })
    , (TokenType
AlertTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
ErrorTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
WarningTok, TokenStyle
defStyle{ tokenItalic = True })
    , (TokenType
ControlFlowTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
PreprocessorTok, TokenStyle
defStyle{ tokenBold = True })
    , (TokenType
DocumentationTok, TokenStyle
defStyle{ tokenItalic = True })
    , (TokenType
AnnotationTok, TokenStyle
defStyle{ tokenItalic = True })
    , (TokenType
CommentVarTok, TokenStyle
defStyle{ tokenItalic = True })
    , (TokenType
InformationTok, TokenStyle
defStyle{ tokenItalic = True })
    ]
  }

-- | Style based on the popular zenburn vim color scheme
zenburn :: Style
zenburn :: Style
zenburn = Style{
    backgroundColor :: Maybe Color
backgroundColor = Int -> Maybe Color
color Int
0x303030
  , defaultColor :: Maybe Color
defaultColor = Int -> Maybe Color
color Int
0xcccccc
  , lineNumberColor :: Maybe Color
lineNumberColor = Maybe Color
forall a. Maybe a
Nothing
  , lineNumberBackgroundColor :: Maybe Color
lineNumberBackgroundColor = Maybe Color
forall a. Maybe a
Nothing
  , tokenStyles :: Map TokenType TokenStyle
tokenStyles = [(TokenType, TokenStyle)] -> Map TokenType TokenStyle
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    [ (TokenType
KeywordTok, TokenStyle
defStyle{ tokenColor = color 0xf0dfaf })
    , (TokenType
DataTypeTok, TokenStyle
defStyle{ tokenColor = color 0xdfdfbf })
    , (TokenType
DecValTok, TokenStyle
defStyle{ tokenColor = color 0xdcdccc })
    , (TokenType
BaseNTok, TokenStyle
defStyle{ tokenColor = color 0xdca3a3 })
    , (TokenType
FloatTok, TokenStyle
defStyle{ tokenColor = color 0xc0bed1 })
    , (TokenType
CharTok, TokenStyle
defStyle{ tokenColor = color 0xdca3a3 })
    , (TokenType
StringTok, TokenStyle
defStyle{ tokenColor = color 0xcc9393 })
    , (TokenType
CommentTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f })
    , (TokenType
OtherTok, TokenStyle
defStyle{ tokenColor = color 0xefef8f })
    , (TokenType
AlertTok, TokenStyle
defStyle{ tokenColor = color 0xffcfaf })
    , (TokenType
FunctionTok, TokenStyle
defStyle{ tokenColor = color 0xefef8f })
    , (TokenType
ErrorTok, TokenStyle
defStyle{ tokenColor = color 0xc3bf9f })
    , (TokenType
WarningTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f, tokenBold = True })
    , (TokenType
ConstantTok, TokenStyle
defStyle{ tokenColor = color 0xdca3a3, tokenBold = True })
    , (TokenType
SpecialCharTok, TokenStyle
defStyle{ tokenColor = color 0xdca3a3 })
    , (TokenType
VerbatimStringTok, TokenStyle
defStyle{ tokenColor = color 0xcc9393 })
    , (TokenType
SpecialStringTok, TokenStyle
defStyle{ tokenColor = color 0xcc9393 })
    , (TokenType
ImportTok, TokenStyle
defStyle)
    , (TokenType
VariableTok, TokenStyle
defStyle)
    , (TokenType
ControlFlowTok, TokenStyle
defStyle{ tokenColor = color 0xf0dfaf })
    , (TokenType
OperatorTok, TokenStyle
defStyle{ tokenColor = color 0xf0efd0 })
    , (TokenType
BuiltInTok, TokenStyle
defStyle)
    , (TokenType
ExtensionTok, TokenStyle
defStyle)
    , (TokenType
PreprocessorTok, TokenStyle
defStyle{ tokenColor = color 0xffcfaf, tokenBold = True })
    , (TokenType
AttributeTok, TokenStyle
defStyle)
    , (TokenType
DocumentationTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f })
    , (TokenType
AnnotationTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f, tokenBold = True })
    , (TokenType
CommentVarTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f, tokenBold = True })
    , (TokenType
InformationTok, TokenStyle
defStyle{ tokenColor = color 0x7f9f7f, tokenBold = True })
    ]
  }