|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jidesoft.utils.ColorUtils
public class ColorUtils
Several useful methods for Color.
| Constructor Summary | |
|---|---|
ColorUtils()
|
|
| Method Summary | |
|---|---|
static float[] |
applyDifference(float[] from,
int[] diff)
|
static int[] |
calculateDifferent(float[] from,
float[] to)
|
static Color |
getDerivedColor(Color color,
float ratio)
Gets a derived color from an existing color. |
static int |
HSLtoRGB(float[] hsl)
Converts from HSL color space to RGB color. |
static float[] |
RGBtoHSL(Color colorRGB)
Converts a color from RBG to HSL color space. |
static Color[] |
toColors(boolean hasAlpha,
int... colors)
Simply calls new Color(color, hasalpha) for each color in colors and returns all of them. |
static Color |
toGrayscale(Color c)
Converts from a color to gray scale color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColorUtils()
| Method Detail |
|---|
public static Color getDerivedColor(Color color,
float ratio)
color - the given color.ratio - the ratio. 0.5f if the same color. Any ratio greater than 0.5f will make the result color lighter.
Smaller than 0.5f will make the color darker.
public static float[] RGBtoHSL(Color colorRGB)
colorRGB - the Color.
public static int HSLtoRGB(float[] hsl)
hsl - the hsl values.
public static int[] calculateDifferent(float[] from,
float[] to)
public static float[] applyDifference(float[] from,
int[] diff)
public static Color[] toColors(boolean hasAlpha,
int... colors)
hasAlpha - true to consider the alpha when creating the Color.colors - the color value.
public static Color toGrayscale(Color c)
c - a color.
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||