|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.colour.CIELuv
public class CIELuv
Utilities for handling the CIELuv colour space. This space is approximately perceptually
uniform in that two colours a fixed distance apart in the colour space should be equally
distinguishable from each other regardless of their location.
For details see
en.wikipedia.org/wiki/CIELUV_color_space.
Includes methods for creating colour tables from this space that maximise the use of the
colour space with similar appearance to Brewer colour schemes. This is based on the
process described by Wijffelaars, Vliegen, van Wijk and van der Linden (2008)
Generating color palettes using intuitive parameters, Computer Graphics Forum,27(3).
Constructor Summary | |
---|---|
CIELuv()
Creates a CIELuv converter using the default D65 illuminant with 2 degree observer position. |
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CIELuv()
Method Detail |
---|
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 double[] getMostSaturatedColour(double hue)
hue
- Hue whose most saturated colour is to be found. This should be a value scaled between 0-360 degrees.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |