|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opengts.util.ColorTools
public class ColorTools
Color handling and conversion tools
| Nested Class Summary | |
|---|---|
static class |
ColorTools.RGB
RGB class. |
| Field Summary | |
|---|---|
static ColorTools.RGB |
BLACK
|
static ColorTools.RGB |
BLUE
|
static ColorTools.RGB |
BROWN
|
static ColorTools.RGB |
COLOR_BLACK
|
static ColorTools.RGB |
COLOR_BLUE
|
static ColorTools.RGB |
COLOR_BROWN
|
static ColorTools.RGB |
COLOR_GRAY
|
static ColorTools.RGB |
COLOR_GREEN
|
static ColorTools.RGB |
COLOR_ORANGE
|
static ColorTools.RGB |
COLOR_PURPLE
|
static ColorTools.RGB |
COLOR_RED
|
static ColorTools.RGB |
COLOR_WHITE
|
static ColorTools.RGB |
COLOR_YELLOW
|
static ColorTools.RGB |
CYAN
|
static ColorTools.RGB |
DARK_GRAY
|
static ColorTools.RGB |
DARK_YELLOW
|
static ColorTools.RGB |
GRAY
|
static ColorTools.RGB |
GREEN
|
static ColorTools.RGB |
LIGHT_GRAY
|
static ColorTools.RGB |
MAGENTA
|
static ColorTools.RGB |
ORANGE
|
static ColorTools.RGB |
PINK
|
static ColorTools.RGB |
PURPLE
|
static ColorTools.RGB |
RED
|
static ColorTools.RGB |
WHITE
|
static ColorTools.RGB |
YELLOW
|
| Constructor Summary | |
|---|---|
ColorTools()
|
|
| Method Summary | |
|---|---|
static java.awt.Color |
darker(java.awt.Color c,
float percent)
Creates a new Color that is darker than the specified Color |
static boolean |
isColor(java.lang.String color)
Returns true if the specified string is a valid color |
static java.awt.Color |
lighter(java.awt.Color c,
float percent)
Creates a new Color that is lighter than the specified Color |
static java.awt.Color |
mix(java.awt.Color color1,
java.awt.Color color2)
Creates a new Color that is the average of the 2 specified Colors, based on a 50% weighting from the first Color to the second Color. |
static java.awt.Color |
mix(java.awt.Color color1,
java.awt.Color color2,
double weight)
Creates a new Color that is a mix of the 2 specified Colors, based on the specified 'weighting' from the first Color to the second Color. |
static java.awt.Color |
mix(java.awt.Color color1,
java.awt.Color color2,
float weight)
Creates a new Color that is a mix of the 2 specified Colors, based on the specified 'weighting' from the first Color to the second Color. |
static java.awt.Color |
parseColor(java.lang.String color,
java.awt.Color dft)
Parses the Color String representation into a Color instance. |
static ColorTools.RGB |
parseColor(java.lang.String color,
ColorTools.RGB dft)
Parses the Color String representation into a Color instance. |
static java.lang.String |
toHexString(java.awt.Color color)
Returns a hex String representation of the specified Color. |
static java.lang.String |
toHexString(java.awt.Color color,
boolean inclHash)
Returns a hex String representation of the specified Color. |
static java.lang.String |
toHexString(int color,
boolean inclHash)
Returns a hex String representation of the specified Color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static ColorTools.RGB BLACK
public static ColorTools.RGB BROWN
public static ColorTools.RGB RED
public static ColorTools.RGB ORANGE
public static ColorTools.RGB YELLOW
public static ColorTools.RGB DARK_YELLOW
public static ColorTools.RGB GREEN
public static ColorTools.RGB BLUE
public static ColorTools.RGB PURPLE
public static ColorTools.RGB GRAY
public static ColorTools.RGB DARK_GRAY
public static ColorTools.RGB LIGHT_GRAY
public static ColorTools.RGB WHITE
public static ColorTools.RGB CYAN
public static ColorTools.RGB PINK
public static ColorTools.RGB MAGENTA
public static ColorTools.RGB COLOR_BLACK
public static ColorTools.RGB COLOR_BROWN
public static ColorTools.RGB COLOR_RED
public static ColorTools.RGB COLOR_ORANGE
public static ColorTools.RGB COLOR_YELLOW
public static ColorTools.RGB COLOR_GREEN
public static ColorTools.RGB COLOR_BLUE
public static ColorTools.RGB COLOR_PURPLE
public static ColorTools.RGB COLOR_GRAY
public static ColorTools.RGB COLOR_WHITE
| Constructor Detail |
|---|
public ColorTools()
| Method Detail |
|---|
public static ColorTools.RGB parseColor(java.lang.String color,
ColorTools.RGB dft)
color - The color String representation to parsedft - The default Color returned if unable to parse a Color from the String
public static boolean isColor(java.lang.String color)
color - The color String representation to test
public static java.awt.Color lighter(java.awt.Color c,
float percent)
c - The Color to make lighterpercent - The percent to make lighter
public static java.awt.Color darker(java.awt.Color c,
float percent)
c - The Color to make darkerpercent - The percent to make darker
public static java.awt.Color mix(java.awt.Color color1,
java.awt.Color color2)
color1 - The first Color which will be averagedcolor2 - The second Color which will be averaged
public static java.awt.Color mix(java.awt.Color color1,
java.awt.Color color2,
float weight)
color1 - The first Color which will be averagedcolor2 - The second Color which will be averagedweight - The 'weighting' from the first Color to the second Color.
A 'weight' of '0.0' will produce the first Color.
A 'weight' of '1.0' will produce the second Color.
public static java.awt.Color mix(java.awt.Color color1,
java.awt.Color color2,
double weight)
color1 - The first Color which will be averagedcolor2 - The second Color which will be averagedweight - The 'weighting' from the first Color to the second Color.
A 'weight' of '0.0' will produce the first Color.
A 'weight' of '1.0' will produce the second Color.
public static java.awt.Color parseColor(java.lang.String color,
java.awt.Color dft)
color - The color String representation to parsedft - The default Color returned if unable to parse a Color from the String
public static java.lang.String toHexString(java.awt.Color color)
color - The Color to convert to a String representation
public static java.lang.String toHexString(java.awt.Color color,
boolean inclHash)
color - The Color to convert to a String representationinclHash - Prefix with '#' if true
public static java.lang.String toHexString(int color,
boolean inclHash)
color - The RGB value to convert to a String representationinclHash - Prefix with '#' if true
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||