Analyze color

Syntax

	$color.colorValues()

Description

Splits a color into its components.

Parameters

Color name Type Type Description Mandatory Default color
color Color The color to be analyzed Yes -

Return value

Type: JSON object with the color properties

The analysis result contains the following properties:

  • r the red value.
  • g the green value.
  • b the blue value.
  • a the alpha value.
  • h the color angle.
  • s The saturation.
  • l The colorfulness.

Examples

Analyze CSS color

	"red".colorValues()

Output:

{
    r: 255,
    g: 0,
    b: 0,
    a: 255, 
    h: 0,
    s: 100,
    l: 50
}