RGBA

Instances of this class are descriptions of colors in terms of the primary additive color model (red, green, blue and alpha). A color may be described in terms of the relative intensities of these three primary colors. The brightness of each color is specified by a value in the range 0 to 255, where 0 indicates no color (blackness) and 255 indicates maximum intensity and for alpha 0 indicates transparent and 255 indicates opaque. <p> 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. </p> <p> Application code does <em>not</em> need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no <code>dispose()</code> method is provided. </p>

@see Color @see <a href="http://www.eclipse.org/swt/snippets/#color">Color and RGB snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @since 3.104

Constructors

this
this(int red, int green, int blue, int alpha)

Constructs an instance of this class with the given red, green, blue and alpha values.

this
this(float hue, float saturation, float brightness, float alpha)

Constructs an instance of this class with the given hue, saturation, and brightness.

Members

Functions

getHSBA
float[] getHSBA()

Returns the hue, saturation, and brightness of the color.

opEquals
bool opEquals(Object other)

Compares the argument to the receiver, and returns true if they represent the <em>same</em> object using a class specific comparison.

toHash
size_t toHash()

Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Variables

alpha
int alpha;

the alpha component of the RGBA

rgb
RGB rgb;

the RGB component of the RGBA

Meta