summaryrefslogtreecommitdiffstats
path: root/app/Pretty/Color.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Pretty/Color.hs')
-rw-r--r--app/Pretty/Color.hs58
1 files changed, 58 insertions, 0 deletions
diff --git a/app/Pretty/Color.hs b/app/Pretty/Color.hs
new file mode 100644
index 0000000..e8e48dd
--- /dev/null
+++ b/app/Pretty/Color.hs
@@ -0,0 +1,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"