CIEDE2000 ( color1 color2 -- distance )


Vocabulary
colors.distances

Inputs
color1an object
color2an object


Outputs
distancean object


Definition


:: CIEDE2000 ( color1 color2 -- distance )
color1 >LCHab :> lch1 color2 >LCHab :> lch2 lch1 lch2
[ l>> ] bi@ :> ( l1 l2 ) lch1 lch2 [ c>> ] bi@
:> ( c1 c2 ) lch1 lch2 [ h>> ] bi@ :> ( h1 h2 ) l2 l1 -
:> dl c2 c1 - :> dc c2 c1 * zero?
[ 0 ] [ h1 h2 diff-hue ] if 2 / sind c1 c2 * sqrt * 2 *
:> dh l1 l2 + 2 / :> ml c1 c2 + 2 / :> mc c2 c1 * zero?
[ 0 ] [ h1 h2 mean-hue ] if :> mh ml 50 -
sq :> mls mls dup 20 + sqrt / 0.015 * 1 + :> sl mc 0.045 *
1 + :> sc 1 mh 30 - cosd 0.17 * - mh 2 ~81 more~ ;