These static methods do not require a Color object instance. When
you invoke the method, it is prefixed with the Color classname and
the '.' character.
Color.fromHSBA( h, s, b)
Creates a Color object based on the values for the HSB color model
where:
- h (hue) is any floating-point number. The floor of this
number is subtracted from it to create a fraction between 0 and 1,
which is then multiplied by 360.
- s (saturation) is a floating-point value between zero and
one (numbers within the range 0.0-1.0).
- b (brightness) is a floating-point value between zero and
one (numbers within the range 0.0-1.0).
Color.fromHSBA( h, s, b, a)
Creates a Color object based on the values for the HSB color model
where:
- h (hue) is any floating-point number. The floor of this
number is subtracted from it to create a fraction between 0 and 1,
which is then multiplied by 360.
- s (saturation) is a floating-point value between zero and
one (numbers within the range 0.0-1.0).
- b (brightness) is a floating-point value between zero and
one (numbers within the range 0.0-1.0).
- a (alpha) is the alpha component.
Color.fromRGBA( r, g, b )
Creates an opaque sRGB Color object based on the specified values
where:
- r (red) is within the range (0.0 - 255)
- g green) is within the range (0.0 - 255)
- b (blue) is within the range (0.0 - 255)
Alpha defaults to 1.0. The color used depends on the best match
from the colors available for the output device.
fromRGBA( r, g, b a)
Creates an sRGB Color object based on the specified values where:
- r (red) is within the range (0.0 - 255)
- g green) is within the range (0.0 - 255)
- b (blue) is within the range (0.0 - 255)
- a (alpha) is within the range (0.0 - 255)
The color used depends on the best match from the colors available
for the output device.
Example:
Color.fromRGBA(0.5,0.5,0.5,0.5)