You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemets the CIEDE2000 color difference algorithm, conversion between RGB and lab color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.
Implements the CIEDE2000 color difference algorithm, conversion between RGB and
LAB color and mapping all colors in palette X to the closest color in palette Y
based on the CIEDE2000 difference.
The result above is obvious, but diff.furthest could deal with more
complicated cases.
mapPalette(palette1, palette2)
Returns a mapping from the colors in palette1 to palette2.
paletteMapKey(color)
Return the palette map key for the color, to be used with the result from mapPalette.
diff(color1, color2, bc)
Returns the difference between the lab colors color1 and color2. The parameter bc is optional and
is used as background color when one of the colors uses alpha channels.
rgba color
Object
RGBAColor is an object containing 4 properties: 'R', 'G', 'B', 'A', where 'A' is optional OR
'r', 'g', 'b', 'a', where 'a' is optional . Such as:
{R: 255,G: 1,B: 0}
There is an optional property 'A', which specifies the alpha channel between 0.0
and 1.0. If not present the color will be treated as fully opaque, i.e. A = 1.0.
Each RGBA-color is transformed into a RGB-color before being used to calculate
the CIEDE2000 difference, using the specified background color
(defaults to white).
lab color
Object
LabColor is an object containing 3 properties 'L', 'a', 'b' such as:
{L: 100,a: 0.005,b: -0.010}
palette
Array.<RGBAColor>
Color palette array which contains many RGBAColor objects.
Author
Markus Ekholm
License
3-clause BSD. For details see COPYING.
About
Implemets the CIEDE2000 color difference algorithm, conversion between RGB and lab color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.