|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.guiseframework.style.AbstractModeledColor<C>
C - The type of color component for this color space.public abstract class AbstractModeledColor<C extends java.lang.Enum<C> & ModeledColor.Component>
Abstract representation of a color value in a color space.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.guiseframework.style.ModeledColor |
|---|
ModeledColor.Component |
| Constructor Summary | |
|---|---|
AbstractModeledColor(double... values)
Constructs a color with the given components. |
|
| Method Summary | |
|---|---|
protected static double |
checkComponentValue(double value)
Checks the range of a given color component. |
boolean |
equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. |
long |
getAbsoluteComponent(C component,
int bitDepth)
Determines the absolute value of the given color component with the given bit depth. |
double |
getComponent(C component)
Determines the value of the given color component. |
double[] |
getValues()
|
int |
hashCode()
|
static Color |
valueOf(java.lang.CharSequence charSequence)
Creates a color from a string representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.guiseframework.style.Color |
|---|
asHSL, asRGB |
| Constructor Detail |
|---|
public AbstractModeledColor(double... values)
values - The values of components of the color in the correct color space, each within the range (0.0-1.0), in the order of the component ordinals.
java.lang.NullPointerException - if the components is null.
TODO fix @exception IllegalArgumentException if the number of component values do not equal the number of components.| Method Detail |
|---|
public double[] getValues()
protected static double checkComponentValue(double value)
value - The value to check.
java.lang.IllegalArgumentException - if the given component is outside the range (0.0-1.0).public double getComponent(C component)
getComponent in interface ModeledColor<C extends java.lang.Enum<C> & ModeledColor.Component>component - The color component for which a value should be retrieved.
public long getAbsoluteComponent(C component,
int bitDepth)
getAbsoluteComponent in interface ModeledColor<C extends java.lang.Enum<C> & ModeledColor.Component>component - The color component for which a value should be retrieved.bitDepth - The number of bits to use for the given color component.
getComponent(Enum)public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - The reference object with which to compare.
true if this object is equivalent to the given object.public static Color valueOf(java.lang.CharSequence charSequence)
colorname, one of the HTML color names, which must be in all lowercase without delimiters, such as "aliceblue".#rgb, with hexadecimal representation of RGB color components without regard to case.#rrggbb, with hexadecimal representation of RGB color components without regard to case.rgb(red,green,blue), with decimal representation with a depth of eight bits (0-255).rgb(red%,green%,blue%), with decimal component values multiplied by 100 (0.0-100.0%).rgba(red,green,blue,alpha), with decimal representation with a depth of eight bits (0-255).rgba(red%,green%,blue%,alpha%), with decimal component values multiplied by 100 (0.0%-100.0%).hsl(hue,saturation,lightness), with decimal representation with a depth of eight bits (0-255).hsl(hue%,saturation%,lightness%), with decimal component values multiplied by 100 (0.0-100.0%).transparent color name as equivalent to rgba(0, 0, 0, 0), or black with zero alpha.
charSequence - The character sequence representation of a color.
java.lang.NullPointerException - if the given string is null.
java.lang.IllegalArgumentException - if a color cannot be determined from the given string.HSLColor.valueOf(CharSequence),
RGBColor.valueOf(CharSequence)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||