fromRGBA()

Returns an sRGB Color object with the specified red, green, blue, and (optionally) alpha values.

Syntax

To return an opaque sRGB Color object based on red, green, and blue values:

Color fromRGBA(Numeric r, Numeric g, Numeric b [, Numeric a])
  1. r (red) is within the range (0.0 - 255)
  2. g green) is within the range (0.0 - 255)
  3. b (blue) is within the range (0.0 - 255)
  4. a (alpha, optional) specifies opacity and is within the range 0.0 - 1.0. Alpha defaults to 1.0 if not specified.

The color used depends on the best match from the colors available for the output device.

Usage

Class methods do not require a Color object instance. When you invoke a class method, it is prefixed with the Color class name and the '.' character.

Example

Color.fromRGBA(200,162,200)

This returns a Color object that is lilac and opaque.