The hashCode() method in this class uses the values of the public fields to compute the hash value. When storing instances of the class in hashed collections, do not modify these fields after the object has been inserted.
Application code does not need to explicitly release the
resources managed by each instance when those instances are no longer
required, and thus no dispose() method is provided.
Color, Color and RGB snippets, Sample code and further information
| Modifier and Type | Field and Description |
|---|---|
| public int | alpha
the alpha component of the RGBA |
| public final RGB | rgb
the RGB component of the RGBA |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public | RGBA(int
the red component of the new instance red, int the green component of the new instance green, int the blue component of the new instance blue, int the alpha component of the new instance alpha)Constructs an instance of this class with the given red, green, blue and alpha values. |
| public | RGBA(float
the hue value for the HSBA color (from 0 to 360) hue, float the saturation value for the HSBA color (from 0 to 1) saturation, float the brightness value for the HSBA color (from 0 to 1) brightness, float the alpha value for the HSBA color (from 0 to 255) alpha)Constructs an instance of this class with the given hue, saturation, and brightness. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the object is the same as this object and false otherwisethe object to compare with this object object)Overrides java. |
| public float[] | Returns: color space values in float format:
Returns the hue, saturation, and brightness of the color. |
| public int | Returns: the receiver's hashOverrides java. |
| public String | Returns: a string representation of theRGBAOverrides java. |
| alpha | back to summary |
|---|---|
| public int alpha the alpha component of the RGBA | |
| rgb | back to summary |
|---|---|
| public final RGB rgb the RGB component of the RGBA | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| RGBA | back to summary |
|---|---|
| public RGBA(int red, int green, int blue, int alpha) Constructs an instance of this class with the given red, green, blue and alpha values.
| |
| RGBA | back to summary |
|---|---|
| public RGBA(float hue, float saturation, float brightness, float alpha) Constructs an instance of this class with the given hue, saturation, and brightness.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
| |
| getHSBA | back to summary |
|---|---|
| public float[] getHSBA() Returns the hue, saturation, and brightness of the color.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns an integer hash code for the receiver. Any two
objects that return
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string containing a concise, human-readable description of the receiver. | |