/ src /
src/Colors.hs
1 module Colors where
2
3 import Graphics.UI.WX
4 import Text.Parse
5
6 -- Different spelling of colour/color to distinguish local/wx datatypes.
7 data Colour = RGB !Int !Int !Int deriving (Eq,Show,Read)
8
9 instance Parse Colour where
10 parse = do { isWord "RGB"
11 ; return RGB `apply` parse `apply` parse `apply` parse
12 }
13
14 -- translate local to wx
15 wxcolor :: Colour -> Color
16 wxcolor (RGB r g b) = rgb r g b
17
18 nodeColor, labelBackgroundColor, evidenceColor, evidenceHatchColor,
19 wrongProbabilitiesColor, paneBackgroundColor, activeSelectionColor,
20 inactiveSelectionColor :: Colour
21 nodeColor = lightBlue
22 evidenceColor = lightYellow
23 evidenceHatchColor = licorice
24 labelBackgroundColor = lightYellow
25 paneBackgroundColor = coconut
26 activeSelectionColor = licorice
27 inactiveSelectionColor = lightGrey
28 wrongProbabilitiesColor = lightRed
29
30 testSelectionTestColor, testSelectionTargetColor :: Colour
31 testSelectionTestColor = RGB 0 255 0
32 testSelectionTargetColor = RGB 255 0 0
33
34 lightYellow, lightBlue, lightRed, lightGrey, pink :: Colour
35 lightYellow = RGB 236 236 169
36 lightBlue = RGB 200 255 255
37 lightGrey = RGB 150 150 150
38 lightRed = RGB 255 200 200
39 pink = RGB 255 200 200
40
41 systemGrey :: Color -- wx type
42 systemGrey = colorSystem Color3DFace
43
44 licorice, coconut :: Colour -- names black and white already taken by wx
45 licorice = RGB 0 0 0
46 coconut = RGB 255 255 255
47
48 darkGreen, darkBlue, violet, indigo, darkRed, darkMagenta, darkOrange,
49 orange, lightPink, purple, lightGreen, mediumPurple, darkViolet, gray,
50 darkGrey, darkGray, lightGray, silver, whiteSmoke, aqua, teal, maroon,
51 olive, sienna, brown, fuchsia, turquoise, orangeRed, gold,darkSlateGray
52 :: Colour
53 darkGreen = RGB 0 100 0
54 darkBlue = RGB 0 0 139
55 violet = RGB 238 130 238
56 indigo = RGB 75 0 130
57 darkRed = RGB 139 0 0
58 darkMagenta = RGB 139 0 139
59 darkOrange = RGB 255 140 0
60 orange = RGB 255 165 0
61 lightPink = RGB 255 182 193
62 purple = RGB 128 0 128
63 lightGreen = RGB 144 238 144
64 mediumPurple = RGB 147 112 219
65 darkViolet = RGB 148 0 211
66
67 gray = RGB 128 128 128
68 darkGrey = RGB 169 169 169 -- lighter than grey?
69 darkGray = RGB 169 169 169
70 lightGray = RGB 211 211 211
71 silver = RGB 192 192 192
72 whiteSmoke = RGB 245 245 245
73
74 aqua = RGB 0 255 255
75 teal = RGB 0 128 128
76 maroon = RGB 128 0 0
77 olive = RGB 128 128 0
78 sienna = RGB 160 82 45
79 brown = RGB 165 42 42
80 fuchsia = RGB 255 0 255
81 turquoise = RGB 64 224 208
82 orangeRed = RGB 255 69 0
83 gold = RGB 255 215 0
84 darkSlateGray = RGB 47 79 79