Color.HSLuv.Gamut
(Color v0.12.1)
Copy Markdown
Helpers that compute the sRGB gamut boundary inside CIELUV for HSLuv and HPLuv.
These reimplement the reference algorithm from
https://www.hsluv.org/implementations/ (Alexei Boronine) using the
sRGB working-space XYZ→RGB matrix derived by
Color.RGB.WorkingSpace from Lindbloom's primaries, so the result
matches our Color.SRGB exactly.
Summary
Functions
Returns the six sRGB gamut boundary lines in CIELUV chroma space for
a given L. Each line is {slope, intercept} describing
v = slope * u + intercept in the chroma plane.
Returns the maximum chroma achievable inside the sRGB gamut for the
given (l, h) in CIELUV coordinates, where h is in degrees.
Returns the largest chroma for the given l such that HPLuv is still
achromatic at any hue, i.e. the distance from the origin in uv to
the nearest gamut boundary line.
Functions
Returns the six sRGB gamut boundary lines in CIELUV chroma space for
a given L. Each line is {slope, intercept} describing
v = slope * u + intercept in the chroma plane.
Arguments
lis the CIELUV lightness.
Returns
- A list of six
{slope, intercept}tuples.
Returns the maximum chroma achievable inside the sRGB gamut for the
given (l, h) in CIELUV coordinates, where h is in degrees.
Arguments
lis the CIELUV lightness.his the hue in degrees.
Returns
- A non-negative float.
Returns the largest chroma for the given l such that HPLuv is still
achromatic at any hue, i.e. the distance from the origin in uv to
the nearest gamut boundary line.
Arguments
lis the CIELUV lightness.
Returns
- A non-negative float.