public class HSLColorUtil
extends java.lang.Object
Color objects.| Modifier and Type | Field and Description |
|---|---|
static int |
HUE_INDEX
A convenience repeat of the index for the hue value in hue, saturation and luminance
array return values.
|
static int |
LUMINANCE_INDEX
A convenience repeat of the index for the luminance value in hue, saturation and luminance
array return values.
|
static int |
SATURATION_INDEX
A convenience repeat of the index for the saturation value in hue, saturation and luminance
array return values.
|
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Color |
convertHSLtoRGB(float hue,
float saturation,
float luminance)
Convert a hue, saturation and luminance color value to the standard AWT Color object.
|
static float[] |
convertRGBtoHSL(java.awt.Color inColor)
Convert a standard AWT color to hue, saturation and luminance.
|
static java.awt.Color |
getLighterColor(float[] hslColor,
float amount)
Make a dark color lighter (more luminance) by a specified amount.
|
public static final int HUE_INDEX
public static final int SATURATION_INDEX
public static final int LUMINANCE_INDEX
public static float[] convertRGBtoHSL(java.awt.Color inColor)
inColor - Color to convertHSLColorSpace.HUE_INDEX,
HSLColorSpace.LUMINANCE_INDEX
and HSLColorSpace.SATURATION_INDEX.public static java.awt.Color convertHSLtoRGB(float hue,
float saturation,
float luminance)
hue - The hue of the color from 0.0 to 360.0saturation - The saturation of the color from 0.0 to 1.0luminance - The luminance (brightness) of the color from 0.0 to 1.0Color object closely matching the hue, saturation and luminance
parameters.public static java.awt.Color getLighterColor(float[] hslColor,
float amount)
hslColor - The color to begin with.amount - The amount to adjust luminance (positive for lighter, negative for darker).