Skip to main content

Overview

You can access the color properties of an object or variable through the Expression Editor. You can use these properties in equations, conditional statements, and functions.

Accessing Color Properties

To use the current value of a color’s property, use this structure:
color.property

Color Properties

Get Alpha

color.getAlpha()
Returns the alpha value of the color.

Get Blue

color.getBlue()
Returns the blue value of the color.

Get Brightness

color.getBrightness()
Returns the brightness value of the color.

Get Green

color.getGreen()
Returns the green value of the color.

Get HEX

color.getHex()
Returns the HEX value of the color.

Get Hue

color.getHue()
Returns the hue value of the color.

Get Lightness

color.getLightness()
Returns the lightness value of the color.

Get Red

color.getRed()
Returns the red value of the color.

Get Saturation

color.getSaturation()
Returns the saturation value of the color.

Set Alpha

color.setAlpha(number)
Returns a color with the alpha channel set to the given value (0-1).

Set Blue

color.setBlue(number)
Returns a color with the blue channel set to the given value (0-255).

Set Brightness

color.setBrightness(number)
Returns a color with the brightness set to the given value (0-1).

Set Green

color.setGreen(number)
Returns a color with the green channel set to the given value (0-255).

Set HSB

color.setHSB(hue, saturation, brightness)
Creates a new color with the HSB values (H: 0-360; S: 0-1; B: 0-1).

Set HSL

color.setHSL(hue, saturation, lightness)
Creates a new color with the HSL values (H: 0-360; S: 0-1; L: 0-1).

Set HEX

color.setHex("string")
Returns a color with the HEX set to the given string (ex. “FF0000”).

Set Hue

color.setHue(number)
Returns a color with the hue set to the given value (0-360).

Set Lightness

color.setLightness(number)
Returns a color with the lightness set to the given value (0-1).

Set RGBA

color.setRGBA(red, green, blue, alpha)
Creates a new color with the RGBA values (R, G, B: 0-255; A: 0-1).

Set Red

color.setRed(number)
Returns a color with the red channel set to the given value (0-255).

Set Saturation

color.setSaturation(number)
Returns a color with the saturation set to the given value (0-1).

To HSB

color.toHSB()
Returns the HSB values of the color.

To HSL

color.toHSL()
Returns the HSL values of the color.

To RGB

color.toRGB()
Returns the RGB values of the color.
I