@microsoft/fast-colors > ColorRGBA64

ColorRGBA64 class

A RGBA color with 64 bit channels.

Signature:

export declare class ColorRGBA64 

Example

new ColorRGBA64(1, 0, 0, 1) // red

Constructors

Constructor Modifiers Description
(constructor)(red, green, blue, alpha) Constructs a new instance of the ColorRGBA64 class

Properties

Property Modifiers Type Description
a number The alpha value
b number The blue value
g number The green value
r number The red value

Methods

Method Modifiers Description
clamp() Returns a new ColorRGBA64 with channel values clamped between 0 and 1.
equalValue(rhs) Determines if one color is equal to another.
fromObject(data) static Construct a ColorRGBA64 from a ColorRGBA64Config
roundToPrecision(precision) Returns a new ColorRGBA64 rounded to the provided precision
toObject() Converts the ColorRGBA64 to a ColorRGBA64Config.
toStringHexARGB() Returns the color formatted as a string; #AARRGGBB
toStringHexRGB() Returns the color formatted as a string; #RRGGBB
toStringHexRGBA() Returns the color formatted as a string; #RRGGBBAA
toStringWebRGB() Returns the color formatted as a string; "rgb(0xRR, 0xGG, 0xBB)"
toStringWebRGBA() Returns the color formatted as a string; "rgba(0xRR, 0xGG, 0xBB, a)"