chroma property Null safety

double chroma

Calculates a value representing this color's lightness on a linear scale.

The returned value is calculated by converting this color to an OklabColor and normalizing its lightness value to a linear curve.

Ranges from 0.0 (black) to 1.0 (white), unless the lightness value also falls outside of that range.

Implementation

double get chroma => math
    .pow((toOklabColor().lightness + 0.028) / 1.028, 6.9)
    .roundToPrecision(10)
    .clamp(0, 1)
    .toDouble();