|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.ColorUtils
public final class ColorUtils
This class provides a set of utilities to work with colors.
Constructor Summary | |
---|---|
ColorUtils()
|
Method Summary | |
---|---|
static java.awt.Color |
black(int alpha)
Returns black color with specified alpha |
static java.lang.String |
getHexColor(java.awt.Color color)
Returns hex color string for the specified color. |
static java.lang.String |
getHexColor(int rgb)
Returns hex color string for the specified rgb value. |
static java.awt.Color |
getIntermediateColor(java.awt.Color color1,
java.awt.Color color2,
float progress)
Returns intermediate color between two specified colors. |
static int |
getIntermediateValue(int value1,
int value2,
float progress)
Returns intermediate value between two specified values. |
static java.awt.Color |
getRandomSoftColor(java.awt.Color base)
Returns randomly generated soft color based on the specified color. |
static java.awt.Color |
getTransparentColor(java.awt.Color color,
int alpha)
Returns color with modified alpha value. |
static java.awt.Color |
getWebSafeColor(java.awt.Color color)
Returns web-safe color. |
static int |
getWebSafeValue(int value)
Returns web-safe color value. |
static java.awt.Color |
parseHexColor(java.lang.String hex)
Returns color decoded from a hex color string. |
static java.awt.Color |
parseRgbColor(java.lang.String rgb)
Returns color decoded from an rgb color string. |
static java.awt.Color |
parseRgbColor(java.lang.String rgb,
java.lang.String separator)
Returns color decoded from an rgb color string. |
static java.awt.Color |
removeAlpha(java.awt.Color color)
Returns color with alpha value set to 255. |
static java.awt.Color |
white(int alpha)
Returns white color with specified alpha |
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 java.awt.Color removeAlpha(java.awt.Color color)
color
- color to modify
public static java.awt.Color getTransparentColor(java.awt.Color color, int alpha)
color
- color to processalpha
- new alpha value
public static java.awt.Color getIntermediateColor(java.awt.Color color1, java.awt.Color color2, float progress)
color1
- first colorcolor2
- second colorprogress
- progress of the intermediate color
public static int getIntermediateValue(int value1, int value2, float progress)
value1
- first valuevalue2
- second valueprogress
- progress of the intermediate value
public static java.awt.Color getWebSafeColor(java.awt.Color color)
color
- color to process
public static int getWebSafeValue(int value)
value
- value to process
public static java.lang.String getHexColor(java.awt.Color color)
color
- color to process
public static java.lang.String getHexColor(int rgb)
rgb
- rgb value
public static java.awt.Color parseHexColor(java.lang.String hex)
hex
- hex color string
public static java.awt.Color parseRgbColor(java.lang.String rgb)
rgb
- rgb color string
public static java.awt.Color parseRgbColor(java.lang.String rgb, java.lang.String separator)
rgb
- rgb color stringseparator
- color parts separator
public static java.awt.Color black(int alpha)
alpha
- color alpha
public static java.awt.Color white(int alpha)
alpha
- color alpha
public static java.awt.Color getRandomSoftColor(java.awt.Color base)
base
- color base
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |