compute the distance between two colors - Maple Help

Home : Support : Online Help : Graphics : Packages : ColorTools : ColorTools/Distance

ColorTools[Distance] - compute the distance between two colors

 Calling Sequence Distance(color1, color2)

Parameters

 color1, color2 - colors in formats recognized by ColorTools

Description

 • The Distance command computes the distance between two colors using one of several standard color metrics.  The metric can be chosen by passing a name to the metric option. The cie94, cie00, and cmc metrics are not commutative. For these metrics, color1 is the reference color and color2 is the sample color. In these metrics a distances of less than 0.01 mean the two colors are generally not visually distinguishable.
 • If the metric option is passed a string, then the metric used is the Euclidean distance in the color space represented by that string.
 • All metrics are normalized so that the distance between white and black is equal to 1 unless the raw option is given.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $\mathrm{Distance}\left("Red","#e00"\right)$
 ${0.03644340870}$ (1)
 > $\mathrm{Distance}\left("#fe0000","#ff0000",'\mathrm{metric}'="RGB"\right)$
 ${0.002264119494}$ (2)
 > $\mathrm{Distance}\left(\left[0.99,0.,0.\right],\left[1.,0.,0.\right],'\mathrm{metric}'="RGB",'\mathrm{raw}'\right)$
 ${0.01000000000}$ (3)