|
Oxygen XML Editor 11.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.sync.exml.view.graphics.Color
public class Color
The class used to represent a Color.
Field Summary | |
---|---|
static Color |
COLOR_BLACK
Black color constant. |
static Color |
COLOR_BLUE
Blue color constant. |
static Color |
COLOR_DARK_GRAY
Dark gray color constant. |
static Color |
COLOR_GRAY
Gray color constant. |
static Color |
COLOR_LIGHT_GRAY
Light gray color constant. |
static Color |
COLOR_LIGHT_GREEN
Light green color constant. |
static Color |
COLOR_LIGHT_YELLOW
Light yellow color constant. |
static Color |
COLOR_LIGHTER_BLUE
Lighter blue color constant. |
static Color |
COLOR_LIGHTER_GRAY
Lighter gray color constant. |
static Color |
COLOR_ORANGE
Orange color constant. |
static Color |
COLOR_RED
Red color constant. |
static Color |
COLOR_RED_DARKER
Red darker color constant. |
static Color |
COLOR_WHITE
White color constant. |
Constructor Summary | |
---|---|
Color(int rgb)
Creates an sRGB color from the specified RGB color value. |
|
Color(int r,
int g,
int b)
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255). |
|
Color(int r,
int g,
int b,
int a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255). |
Method Summary | |
---|---|
static Color |
brighter(Color color)
Increase brightness of the color. |
static Color |
darker(Color color)
Decrease the brightness of the color. |
static Color |
darker(Color color,
float percent)
Decrease the brightness of the color. |
static Color |
decodeColor(String colorString)
Method used to decode the given string to a color. |
static Color |
desaturate(Color fillColor,
double percent)
Used for decrease the color saturation with the given percent. |
boolean |
equals(Object obj)
Checks if the two colors have the same RGB value. |
int |
getAlpha()
Returns the alpha component in the range 0-255. |
int |
getBlue()
Returns the blue component in the range 0-255 in the default sRGB space. |
float |
getBrightness()
Gets the L component form the HSL spectrum of the color. |
int |
getGreen()
Returns the green component in the range 0-255 in the default sRGB space. |
int |
getRed()
Returns the red component in the range 0-255 in the default sRGB space. |
int |
getRGB()
Returns the RGB value representing the color in the default sRGB (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue). |
int |
hashCode()
|
String |
toString()
Returns a string representation of this Color . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Color COLOR_LIGHT_GRAY
public static final Color COLOR_WHITE
public static final Color COLOR_BLACK
public static final Color COLOR_RED
public static final Color COLOR_RED_DARKER
public static final Color COLOR_DARK_GRAY
public static final Color COLOR_BLUE
public static final Color COLOR_GRAY
public static final Color COLOR_LIGHT_YELLOW
public static final Color COLOR_LIGHT_GREEN
public static final Color COLOR_ORANGE
public static final Color COLOR_LIGHTER_GRAY
public static final Color COLOR_LIGHTER_BLUE
Constructor Detail |
---|
public Color(int r, int g, int b, int a)
r
- the red component.g
- the green component.b
- the blue component.a
- the alpha component.public Color(int rgb)
rgb
- The value of the RGB color. Bits 24-31 are alpha, 16-23 are red, 8-15 are green,
0-7 are blue.public Color(int r, int g, int b)
r
- the red component.g
- the green component.b
- the blue component.Method Detail |
---|
public int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public int getRGB()
ColorModel
.public String toString()
Color
. This
method is intended to be used only for debugging purposes. The
content and format of the returned string might vary between
implementations. The returned string might be empty but cannot
be null
.
toString
in class Object
Color
.public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
Object.hashCode()
public static Color desaturate(Color fillColor, double percent)
fillColor
- The color to be darkened.percent
- The percent to be used for decrease the color saturation.
public static Color decodeColor(String colorString)
colorString
- The string representation of the color.
public static Color darker(Color color)
color
- The color to be modified.
public static Color darker(Color color, float percent)
color
- The color to be modified.percent
- The percent to be used for darkening a color.
public static Color brighter(Color color)
color
- The color to be modified.
public float getBrightness()
|
Oxygen XML Editor 11.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |