API Docs

Bridge type for working with colors in JavaScript

Properties

This type has no properties.

Methods

staticHSColor.rgb(r, g, b, a) -> HSColor

Create a color from RGB values
HSColor.rgb(r, g, b, a) -> HSColor
Name Type Description
r number Red component (0.0-1.0)
g number Green component (0.0-1.0)
b number Blue component (0.0-1.0)
a number Alpha component (0.0-1.0)
HSColor
An HSColor object

staticHSColor.hex(hex) -> HSColor

Create a color from a hex string
HSColor.hex(hex) -> HSColor
Name Type Description
hex string Hex string (e.g. "#FF0000" or "FF0000")
HSColor
An HSColor object

staticHSColor.named(name) -> HSColor

Create a color from a named system color
HSColor.named(name) -> HSColor
Name Type Description
name string Name of the system color (e.g. "red", "blue", "systemBlue")
HSColor
An HSColor object

set(value) -> None

Update this color's value
set(value) -> None
Name Type Description
value JSValue New color as a hex string (e.g. "#FF0000") or another HSColor object
None