Click or drag to resize

Telogis.GeoBase.Color

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Color Class

Represents a set of color components in RGB-space, with an optional alpha-value.

Constructor
NameDescription
Color(r, g, b, a)

Arguments

  • (Optional)r (Number) - The red component of the color, from 0x00 to 0xff. Alternatively, this may be another Color, invoking a copy constructor. Defaults to 0x00.

  • (Optional)g (Number) - The green component of the color, from 0x00 to 0xff. Defaults to 0x00.

  • (Optional)b (Number) - The blue component of the color, from 0x00 to 0xff. Defaults to 0x00.

  • (Optional)a (Number) - The alpha component of the color, from 0.0 (transparent) to 1.0 (opaque). Defaults to 1.0.

Functions
NameDescription
equals (Color other)

Determines whether the calling Color is equivalent to another, component-wise.

Arguments
  • other (Color) - The Point to compare with the caller.

Returns

Boolean - True if the components of the calling Color and given Color are equivalent; false otherwise.

fromCSSHex (String hexString)

Initializes the color from a HTML/CSS hex string (where the first two digits represent the red value, the third and fourth the green value, and the fifth and sixth the blue value).

Arguments
  • hexString (String) - A hex string of the format '#rrggbb'.

fromHSV (Number h, Number s, Number v)

Sets the RGB components of the Color from hue, saturation and value specifications.

Arguments
  • h (Number) - The hue of the color, in degrees.

  • (Optional) s (Number) - The saturation of the color, from 0.0 (unsaturated) to 1.0 (fully saturated). Defaults to 0x00.

  • v (Number) - The value of the color, from 0.0 to 1.0.

toCSSHex ()

Finds a representation of the color in the form of a CSS hexadecimal string.

Returns

String - A string of the form '#rrggbb'.

toCSSRGBA ()

Finds a representation of the color in the form of a CSS rgba() expression.

Returns

String - A string of the form 'rgba(r,g,b,a)'.

Properties
NameTypeDescription
aNumber

The transparency (alpha value) of the color, from 0.0 (transparent) to 1.0 (opaque).

bNumber

The blue component of the color, from 0x00 to 0xff.

gNumber

The green component of the color, from 0x00 to 0xff.

rNumber

The red component of the color, from 0x00 to 0xff.