public class CIELuv
extends java.lang.Object
Constructor and Description |
---|
CIELuv()
Creates a CIELuv converter using the default D65 illuminant with 2 degree observer
position.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColour(double L,
double u,
double v,
boolean useNearest)
Finds the colour corresponding to the given CIELuv triplet.
|
java.awt.Color |
getColourFromLCh(double L,
double C,
double h)
Finds the colour corresponding to the given CIELCh triplet.
|
java.awt.Color |
getColourFromLCh(double L,
double C,
double h,
boolean findNearest)
Finds the colour corresponding to the given CIELCh triplet.
|
processing.core.PVector |
getLCh(java.awt.Color colour)
Finds the CIELCh triplet representing the given colour.
|
processing.core.PVector |
getLuv(java.awt.Color colour)
Finds the CIELuv triplet representing the given colour.
|
static double[] |
getMostSaturatedColour(double hue)
Finds the most saturated colour for the given hue.
|
ColourTable |
getSequential(double hue1,
double hue2,
double saturation,
double brightness,
int numColours)
Provides a multi-hue sequential scheme using the given hues and having the given number of colours.
|
ColourTable |
getSequential(double hue,
double saturation,
double brightness,
int numColours)
Provides a single hue sequential scheme using the given hue and having the given number of colours.
|
ColourTable |
getSequential(double hue,
int numColours)
Provides a single hue sequential scheme using the given hue and having the given number of colours.
|
public CIELuv()
public processing.core.PVector getLuv(java.awt.Color colour)
colour
- Colour to convert.public processing.core.PVector getLCh(java.awt.Color colour)
colour
- Colour to convert.public java.awt.Color getColour(double L, double u, double v, boolean useNearest)
useNearest
is false, otherwise the approximate nearest
visible colour will be returned. CIELuv L values should be scaled between 0-100,
and a and b values scaled between -100 and 100.L
- CIELuv L value scaled between 0 and 100.u
- CIELuv u value scaled between -100 and 100.v
- CIELiv v 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.public java.awt.Color getColourFromLCh(double L, double C, double h)
L
- CIELuv Lightness value scaled between 0 and 100.C
- CIELuv Chroma value scaled between 0 and 100.h
- CIELiv Hue value scaled between 0 and 360 degrees.public java.awt.Color getColourFromLCh(double L, double C, double h, boolean findNearest)
findNearest
is
true, out-of-gamut colours will be clamped to their nearest visible colour, if not, out-of-gamut
colours are returned as null. CIE LCh L values should be scaled between 0-100, C (Chroma) values
scaled between 0 and 100 and h between 0 and 360 degrees.L
- CIELuv Lightness value scaled between 0 and 100.C
- CIELuv Chroma value scaled between 0 and 100.h
- CIELiv Hue value scaled between 0 and 360 degrees.findNearest
- If true, nearest visible colour will be found.public ColourTable getSequential(double hue, int numColours)
hue
- Hue upon which to base the scheme. This should be a value from 0 to 360 degrees.numColours
- Number of colour values in the colour table, or 0 for continuous scheme.public ColourTable getSequential(double hue, double saturation, double brightness, int numColours)
hue
- Hue upon which to base the scheme. This should be a value from 0 to 360 degrees.saturation
- Saturation of the scheme scaled between 0-1.brightness
- Brightness of the scheme scaled between 0-1.numColours
- Number of colour values in the colour table, or 0 for continuous scheme.public ColourTable getSequential(double hue1, double hue2, double saturation, double brightness, int numColours)
hue1
- First hue upon which to base the scheme. This should be a value from 0 to 360 degrees.hue2
- Second hue upon which to base the scheme. This should be a value from 0 to 360 degrees.saturation
- Saturation of the scheme scaled between 0-1.brightness
- Brightness of the scheme scaled between 0-1.numColours
- Number of colour values in the colour table, or 0 for continuous scheme.public static double[] getMostSaturatedColour(double hue)
hue
- Hue whose most saturated colour is to be found. This should be a value scaled between 0-360 degrees.