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:
rthe red value.gthe green value.bthe blue value.athe alpha value.hthe color angle.sThe saturation.lThe colorfulness.
Examples
Analyze CSS color
"red".colorValues()
Output:
{
r: 255,
g: 0,
b: 0,
a: 255,
h: 0,
s: 100,
l: 50
}