pureweb. PureWebColor

Represents of a color in terms of alpha, red, green, and blue components. PureWeb colors are the same across platforms. They are used by the acetate tools to display markup on view overlays. For more information on the acetate functionality, see AcetateToolDelegate.
The methods in this class can also be used to create a PureWebColor from the specified (unsigned) integer.

Method Summary

getAlpha
Returns the alpha component of this color.
getBlue
Returns the blue component of this color.
getColor
Returns a color as an unsigned integer.
getGreen
Returns the green component of this color.
getRed
Returns the red component of this color.
toRGBAString
Returns this PureWeb color, expressed as a string formatted as rgba (red, green, blue, alpha).
toString
Returns this PureWeb color, expressed as a hexadecimal triplet beginning with a hash.
tryParse
Tries to parse the provided string into a PureWeb color.

Constructor

new PureWebColor(color)

Initializes a new instance of PureWebColor.
Parameters:
Name Type Description
color number The color.

Method Detail

getAlpha() → {number}

Returns the alpha component of this color.

getBlue() → {number}

Returns the blue component of this color.

getColor() → {number}

Returns a color as an unsigned integer.

getGreen() → {number}

Returns the green component of this color.

getRed() → {number}

Returns the red component of this color.

toRGBAString() → {string}

Returns this PureWeb color, expressed as a string formatted as rgba (red, green, blue, alpha).

toString() → {string}

Returns this PureWeb color, expressed as a hexadecimal triplet beginning with a hash.

<static> tryParse(value) → {pureweb.PureWebColor|null}

Tries to parse the provided string into a PureWeb color. Will return null if the attempt fails.
Parameters:
Name Type Argument Description
value string <nullable>
The string to parse.