summaryrefslogtreecommitdiffstats
path: root/app/Pretty/Color.hs
blob: e8e48ddb6c6d04dfd8ddaf2ecc97b8b967464844 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}

module Pretty.Color
  ( Color (..),
    toRgb,
    Intensity (..),
  )
where

data Color
  = Black
  | Red
  | Green
  | Yellow
  | Blue
  | Magenta
  | Cyan
  | White
  deriving (Show, Eq, Ord)

toRgb :: (Intensity, Color) -> String
toRgb (Dull, Black) = base00 -- color0
toRgb (Dull, Red) = base08 -- color1
toRgb (Dull, Green) = base0B -- color2
toRgb (Dull, Yellow) = base0A -- color3
toRgb (Dull, Blue) = base0D -- color4
toRgb (Dull, Magenta) = base0E -- color5
toRgb (Dull, Cyan) = base0C -- color6
toRgb (Dull, White) = base05 -- color7
toRgb (Vivid, Black) = base03 -- color8
toRgb (Vivid, Red) = base08 -- color9
toRgb (Vivid, Green) = base0B -- color10
toRgb (Vivid, Yellow) = base0A -- color11
toRgb (Vivid, Blue) = base0D -- color12
toRgb (Vivid, Magenta) = base0E -- color13
toRgb (Vivid, Cyan) = base0C -- color14
toRgb (Vivid, White) = base07 -- color15

data Intensity = Vivid | Dull
  deriving (Show, Eq, Ord)

base00, base01, base02, base03, base04, base05, base06, base07, base08, base09, base0A, base0B, base0C, base0D, base0E, base0F :: String
base00 = "#263238"
base01 = "#2E3C43"
base02 = "#314549"
base03 = "#546E7A"
base04 = "#B2CCD6"
base05 = "#EEFFFF"
base06 = "#EEFFFF"
base07 = "#FFFFFF"
base08 = "#F07178"
base09 = "#F78C6C"
base0A = "#FFCB6B"
base0B = "#C3E88D"
base0C = "#89DDFF"
base0D = "#82AAFF"
base0E = "#C792EA"
base0F = "#FF5370"