Module color.interpolate
Color interpolation with explicit color-space and hue semantics.
Use the overload matching the space in which you want the transition to occur. Rectangular interpolation stays in that space. OKLCH interpolation requires an explicit hue path. Alpha-aware overloads weight coordinates by opacity. No overload silently converts color spaces, clips, or gamut-maps.
Functions
| Name | Description |
|---|---|
interpolate(first, second, t)
|
Blends two encoded sRGB values component by component. |
interpolate(first, second, t)
|
Blends two linear-light sRGB values component by component. |
interpolate(first, second, t)
|
Blends two colors in rectangular Oklab coordinates. |
interpolate(first, second, t, path)
|
Blends two colors in OKLCH using an explicit route around the hue circle. |
interpolate(first, second, t)
|
Interpolates straight-alpha encoded sRGB using alpha-weighted coordinates. |
interpolate(first, second, t)
|
Interpolates straight-alpha linear-light sRGB using alpha-weighted coordinates. |
interpolate(first, second, t)
|
Interpolates straight-alpha Oklab using alpha-weighted coordinates. |
interpolate(first, second, t, path)
|
Interpolates straight-alpha OKLCH using explicit polar hue semantics. |
Enums
| Name | Description |
|---|---|
HuePath
|
Chooses how OKLCH interpolation travels between two hue angles. |