|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--ru.novosoft.dc.rtf.dom.objects.RTFColor
The RTF color class.
| Constructor Summary | |
RTFColor(int red,
int green,
int blue)
Construct an RTF color from red, green, and blue components. |
|
| Method Summary | |
int |
blue()
Return the blue component of the color. |
double |
brightness()
Return the brightnees of the color as a double value at the segment [0,1]. |
boolean |
equals(java.lang.Object obj)
Compare this color with another color and return true if colors coinside. |
int |
green()
Return the green component of the color. |
double |
hue()
Return the hue of the color as a double value at the segment [0,1]. |
RTFColor |
mixedColor(RTFColor color,
double r)
Mix this color with another color in the specified ratio and return the mixed color. |
boolean |
needInvertAutoColor()
Return true if this color is too dark as a background color (the additive lightness of RGB components less than 155). |
int |
red()
Return the red component of the color. |
double |
saturation()
Return the saturation of the color as a double value at the segment [0,1]. |
java.lang.String |
toString()
Convert a color to the hexadecimal number in the form "#XXXXXX". |
static java.lang.String |
toString(int colorValue)
Convert an integer color value to the hexadecimal number of the form "#XXXXXX", where pairs of digits correspond to RED, GREEN, and BLUE intensities from the left to the right. |
static java.lang.String |
toTwoHexDigits(int value)
Convert the low byte of an integer value to the upper-case hexadecimal string of two digits. |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public RTFColor(int red,
int green,
int blue)
| Method Detail |
public final int red()
public final int green()
public final int blue()
public double brightness()
public double saturation()
public double hue()
public boolean equals(java.lang.Object obj)
public java.lang.String toString()
public static java.lang.String toString(int colorValue)
public static java.lang.String toTwoHexDigits(int value)
public RTFColor mixedColor(RTFColor color,
double r)
mixed.component()=this.component()*(1-r)+color.component()*r,
where component() means red(), green(), and blue().
If r is out of segment [0,1], inpredictable color is returned.color - another color to mix withr - a ratio of mixing (a value from the segment [0,1])public final boolean needInvertAutoColor()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||