A color conversion library in the Uiua language.
The examples are best viewed with the --window feature or on the pad.
There is a function XToY for any two of the following color spaces:
| Name | Color space |
|---|---|
Srgb |
sRGB |
Linear |
linear sRGB |
Oklab |
Oklab |
Oklch |
Oklch (hue in radians) |
Oklchd |
Oklch (hue in degrees) |
Hsv |
HSV-transformed sRGB (hue in radians) |
Hsvd |
HSV (hue in degrees) |
Also, SrgbToX conversions are aliased to just X, following the hsv primitive.
Conversions require the input array to have (a leading axis of) length 3, instead of having a trailing axis of length 3. This makes it easier to operate on color channels.
However, to allow grayscale images, conversions between Srgb and Linear can take a number array of any shape.