Bridge type for working with colors in JavaScript

Properties

This type has no properties.

Methods

static HSColor.rgb(r, g, b, a)

Create a color from RGB values

Parameters

  • 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)

Returns

HSColor - An HSColor object

static HSColor.hex(hex)

Create a color from a hex string

Parameters

  • hex string

    Hex string (e.g. "#FF0000" or "FF0000")

Returns

HSColor - An HSColor object

static HSColor.named(name)

Create a color from a named system color

Parameters

  • name string

    Name of the system color (e.g. "red", "blue", "systemBlue")

Returns

HSColor - An HSColor object

set(value)

Update this color's value

Parameters

  • value JSValue

    New color as a hex string (e.g. "#FF0000") or another HSColor object

Returns

Nothing