Red channel (0-1)
Green channel (0-1)
Blue channel (0-1)
Alpha channel (0-1)
Alpha channel (0-1)
Blue channel (0-1)
Green channel (0-1)
Red channel (0-1)
Return a new Color with the same channel values.
Darken by a factor (0-1). Does not affect alpha.
Linearly interpolate toward another Color by factor t (0-1).
Lighten by a factor (0-1). Does not affect alpha.
Set all channels. Returns this for chaining.
Convert to a "#rrggbb" hex string.
Convert to an "rgba(r,g,b,a)" CSS string.
Convert to a CSS color string (hex if opaque, rgba otherwise).
StaticfromParse a hex string ("#rgb", "#rrggbb", "#rrggbbaa") or "rgba(...)" into a Color.
StaticfromCreate a Color from HSL values.
Hue in degrees (0-360)
Saturation (0-1)
Lightness (0-1)
StatichslCreate a Color from HSL with percentage saturation/lightness.
Hue in degrees (0-360)
Saturation (0-100)
Lightness (0-100)
Optionala: numberStaticrgbCreate a Color from 0-255 RGB values.
Optionala: number
RGBA color with components in 0-1 range.