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 an object’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 RBG
color.toRGB()
Returns the RGB values of the color.
Color Functions
RBGA
Value
rgba(red, green, blue, alpha)
Returns a color with RGBA values (R, G, B: 0-255; A: 0-1).
Array
rgba([red, green, blue, alpha])
Returns a color with RGBA values (R, G, B: 0-255; A: 0-1).
RBG To HSL
Value
rgbToHSL(red, green, blue)
Converts RGB values to an array of HSL values (R, G, B: 0-255).
Array
rgbToHSL([red, green, blue])
Converts an array of RGB values to an array of HSL values (R, G, B: 0-255).
RBG To HSB
Value
rgbToHSB(red, green, blue)
Converts RGB values to an array of HSB values (R, G, B: 0-255).
Array
rgbToHSB([red, green, blue])
Converts an array of RGB values to an array of HSB values (R, G, B: 0-255).
HSLA
Value
hsla(hue, saturation, lightness, alpha)
Returns a color with HSL values (H: 0-360; S, L, A: 0-1)).
Array
hsla([hue, saturation, lightness, alpha])
Returns a color with HSL values (H: 0-360; S, L, A: 0-1).
HSL To RGB
Value
hslToRGB(hue, saturation, lightness)
Converts HSL values to an array of RGB values (H: 0-360; S, L: 0-1).
Array
hslToRGB([hue, saturation, lightness])
Converts an array of HSL values to an array of RGB values (H: 0-360; S, L: 0-1).
HSL To HSB
Value
hslToHSB(hue, saturation, lightness)
Converts HSL values to an array of HSB values (H: 0-360; S, L: 0-1).
Array
hslToHSB([hue, saturation, lightness])
Converts an array of HSL values to an array of HSB values (H: 0-360; S, L: 0-1).
HSBA
Value
hsba(hue, saturation, brightness, alpha)
Returns a color with HSB values (H: 0-360; S, B, A: 0-1)).
Array
hsba([hue, saturation, brightness, alpha])
Returns a color with HSB values (H: 0-360; S, B, A: 0-1).
HSB To RGB
Value
hsbToRGB(hue, saturation, brightness)
Converts HSB values to an array of RGB values (H: 0-360; S, B: 0-1).
Array
hsbToRGB([hue, saturation, brightness])
Converts an array of HSB values to an array of RGB values (H: 0-360; S, B: 0-1).
HSB To HSL
Value
hsbToHSL(hue, saturation, brightness)
Converts HSB values to an array of HSL values (H: 0-360; S, B: 0-1).
Array
hslToHSB([hue, saturation, lightness])
Converts an array of HSB values to an array of HSL values (H: 0-360; S, B: 0-1).
HEX
hex("string")
Returns a color with the given HEX code.
Blend Color
blendColor(color, color, percent)
Blends two colors based on a percentage (0-1).