Color
Color with red, green, blue and alpha components. Each RGB component is a number between 0.0 and 1.0 indicating the component's intensity. The alpha component is a number between 0.0 (fully transparent) and 1.0 (fully opaque) indicating the color's opacity.
Constructors
Constructs a color with red, green, blue and alpha all 1.0.
Constructs a color from integer components
Constructs a color with components stored in a color int. Color ints are stored as packed ints as follows: (alpha << 24) | (red << 16) | (green << 8) | (blue). Each component is an 8 bit number between 0 and 255 with 0 indicating the component's intensity.
Constructs a color with the components of a specified color.
Properties
Functions
Premultiplies this color in place. The RGB components are multiplied by the alpha component.
Premultiplies the specified color and stores the result in this color. This color's RGB components are set to the product of the specified color's RGB components and its alpha component. This color's alpha component is set to the specified color's alpha.
Copies this color's premultiplied components to the specified array. The result is compatible with GLSL uniform vectors, and can be passed to the function glUniform4fv.
Sets this color to the components stored in a color int. Color ints are stored as packed ints as follows: (alpha << 24) | (red << 16) | (green << 8) | (blue). Each component is an 8 bit number between 0 and 255 with 0 indicating the component's intensity.
Sets this color to the specified components.
Copies this color's components to the specified array. The result is compatible with GLSL uniform vectors, and can be passed to the function glUniform4fv.
Returns a string representation of this color, indicating the byte values corresponding to this color's floating-point component values.
Returns this color's components as a color int. Color ints are stored as packed ints as follows: `(alpha <<
Determine contrast background color for any input color
Create a rgba color string that conforms to CSS Color Module Level 3 specification.
Create a hex color string that CSS can use. Optionally, inhibit capturing alpha, because some uses reject a four-component color specification.
Convert the argb color to its HSV components. hsv0 is Hue [0 .. 360) hsv1 is Saturation 0...1 hsv2 is Value 0...1