Color
A color represented by RGB components in the linear working color space, which defaults to ColorSpace.LinearSRGB. Inputs conventionally using ColorSpace.SRGB (such as hexadecimals) are converted to the working color space automatically. If ColorManagement.enabled is false, no conversions occur.
Colors are mutable and not thread-safe. Use each instance from one thread only. Most methods change this and return it for chaining.
Iterating a color yields its components (r, g, b) in order.
CSS strings and color names
There is no setStyle, setColorName, getStyle or Color.NAMES, so CSS strings such as "#ff8800" and names such as "skyblue" are not accepted. Use the Color constructors, setHex, setRGB or setHSL instead.
Constructors
Constructs a white color (r = g = b = 1).
Constructs a color from the RGB components r, g, b (via setRGB, i.e. interpreted in the working color space).
Constructs a color from the hexadecimal value hex (via setHex, i.e. interpreted as ColorSpace.SRGB by default).
Constructs a color as a copy of color.
Properties
Functions
Transforms this color with the 3x3 matrix m.
Converts this color from ColorSpace.LinearSRGB to ColorSpace.SRGB.
Converts this color from ColorSpace.SRGB to ColorSpace.LinearSRGB.
Copies color into this color, then converts from ColorSpace.LinearSRGB to ColorSpace.SRGB.
Copies color into this color, then converts from ColorSpace.SRGB to ColorSpace.LinearSRGB.
Returns the hexadecimal value of this color (in colorSpace, default ColorSpace.SRGB).
Returns the hexadecimal value of this color as a 6-digit lowercase string (for example, "ffffff").
Multiplies this color's RGB values by the scalar s.
Sets this color's RGB components from the 3D vector v (r = x, g = y, b = z).
Sets this color from a hexadecimal value.