-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolour.txt
89 lines (84 loc) · 2.95 KB
/
colour.txt
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
max expr size = 4
|- on ineqs = 2
|- on conds = 3
max #-tests = 500
min #-tests = 25 (to consider p ==> q true)
max #-vars = 2 (for inequational and conditional laws)
_ :: Colour
_ :: Integer
_ :: Maybe (Ratio Integer)
_ :: Ratio Integer
(+) :: Colour -> Colour -> Colour
(-) :: Colour -> Colour -> Colour
chroma :: Colour -> Ratio Integer
hue :: Colour -> Maybe (Ratio Integer)
saturation :: Colour -> Ratio Integer
value :: Colour -> Ratio Integer
lightness :: Colour -> Ratio Integer
fromHSV :: Ratio Integer -> Ratio Integer -> Ratio Integer -> Colour
fromHSL :: Ratio Integer -> Ratio Integer -> Ratio Integer -> Colour
mix :: Colour -> Colour -> Colour
black :: Colour
white :: Colour
red :: Colour
grey :: Colour
green :: Colour
blue :: Colour
Just :: Ratio Integer -> Maybe (Ratio Integer)
Nothing :: Maybe (Ratio Integer)
0 % 1 :: Ratio Integer
1 % 1 :: Ratio Integer
1 % 2 :: Ratio Integer
Warning: (<=) :: Colour -> Colour -> Bool is not an ordering (not antisymmetric)
Warning: (==) and (<=) :: Colour -> Colour -> Bool are inconsistent: (x == y) /= (x <= y && y <= x)
mix c c == c
c + black == c
c - c == black
c - black == c
c + white == white
black - c == black
c - white == black
fromHSV q r (0 % 1) == black
fromHSL q r (0 % 1) == black
fromHSL q r (1 % 1) == white
fromHSL q (0 % 1) (1 % 2) == grey
c + d == d + c
mix c d == mix d c
fromHSL q (0 % 1) r == fromHSL s (0 % 1) r
fromHSV q (0 % 1) r == fromHSL s (0 % 1) r
fromHSV (1 % 1) q r == fromHSV (0 % 1) q r
fromHSL (1 % 1) q r == fromHSL (0 % 1) q r
fromHSL q (1 % 1) (1 % 2) == fromHSV q (1 % 1) (1 % 1)
hue (mix c black) == hue c
hue (mix c white) == hue c
hue (mix c grey) == hue c
hue (c + c) == hue (c + grey)
value (c + red) == 1 % 1
value (c + green) == 1 % 1
value (c + blue) == 1 % 1
chroma (white - c) == chroma c
saturation (mix c black) == saturation c
chroma (grey - c) == chroma (c + grey)
chroma (mix c white) == chroma (mix c black)
chroma (mix c grey) == chroma (mix c black)
saturation (c + red) == chroma (c + red)
saturation (c + green) == chroma (c + green)
saturation (c + blue) == chroma (c + blue)
value (c - red) == chroma (c - red)
value (c - green) == chroma (c - green)
value (c - blue) == chroma (c - blue)
value (red - c) == chroma (red - c)
value (green - c) == chroma (green - c)
value (blue - c) == chroma (blue - c)
hue c <= Just (1 % 1)
0 % 1 <= chroma c
0 % 1 <= saturation c
0 % 1 <= value c
0 % 1 <= lightness c
chroma c <= 1 % 1
saturation c <= 1 % 1
value c <= 1 % 1
lightness c <= 1 % 1
chroma c <= saturation c
chroma c <= value c
lightness c <= value c