Handbook
Glossary
CIE94 ( color1 color2 -- distance )
Vocabulary
colors
.
distances
Inputs
color1
an
object
color2
an
object
Outputs
distance
an
object
Definition
USING:
accessors
colors.lab
kernel
math
math.functions
;
IN:
colors.distances
::
CIE94
( color1 color2 -- distance )
color1
>laba
:>
lab1 color2
>laba
:>
lab2 lab1 lab2
[
l>>
]
bi@
:>
( l1 l2 ) lab1 lab2
[
a>>
]
bi@
:>
( a1 a2 ) lab1 lab2
[
b>>
]
bi@
:>
( b1 b2 ) l2 l1
-
:>
dl a2 a1
-
:>
da b2 b1
-
:>
db a1
sq
b1
sq
+
sqrt
:>
c1 a2
sq
b2
sq
+
sqrt
:>
c2 c2 c1
-
:>
dc da
sq
db
sq
+
dc
sq
-
sqrt
:>
dh 1 0.045 0.015
:>
( kl k1 k2 ) kl
:>
sl k1 c1
*
1
+
:>
sc k2 c1
*
1
+
:>
sh dl sl
/
sq
dc sc
/
sq
+
dh sh
/
sq
+
sqrt
;