public class CIELab
extends java.lang.Object
| Constructor and Description |
|---|
CIELab()
Creates a CIELab converter using the default D65 illuminant with 2 degree observer
position.
|
CIELab(ColourConverter.WhitePoint wp)
Creates a CIELab converter using the given reference calibration settings.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getColour(double L,
double a,
double b,
boolean useNearest)
Finds the colour corresponding to the given CIELab triplet.
|
processing.core.PVector |
getLab(java.awt.Color colour)
Finds the CIELab triplet representing the given colour.
|
public CIELab()
public CIELab(ColourConverter.WhitePoint wp)
wp - Colour calibration reference to use in the CIELab conversion.public processing.core.PVector getLab(java.awt.Color colour)
colour - Colour to convert.public java.awt.Color getColour(double L,
double a,
double b,
boolean useNearest)
useNearest is false, otherwise the approximate nearest
visible colour will be returned. CIELab L values should be scaled between 0-100,
and a and b values scaled between -100 and 100. Based on the conversion code by Duane
Schwartzwald, 12th March, 2006 and Harry Parker, Feb 27th, 2007.
See
rsbweb.nih.gov/ij/plugins/download/Color_Space_Converter.java.L - CIELab L value scaled between 0 and 100.a - CIELab a value scaled between -100 and 100.b - CIELab b value scaled between -100 and 100.useNearest - If true, out-of-gamut colours will be converted to their nearest visible
equivalent. If not, out-of-gamut colours returned as null.