feat: add OKLCH color space support

Add OKLCH struct and conversion methods (sRGB ↔ OKLab ↔ OKLCH) using
Björn Ottosson's matrices. Includes:

- SimpleColor.ToOKLCH() and FromOKLCH() for color conversion
- SimpleColor.ClampOKLCH() for bounding lightness/chroma
- SimplePalette.ClampOKLCH(), NormalizeLightness(), NormalizeChroma()
  for palette-level OKLCH operations
- Comprehensive tests with round-trip, known values, and clamping
This commit is contained in:
2026-02-22 21:32:45 +00:00
parent 42fd438273
commit 3d35bdf700
3 changed files with 282 additions and 1 deletions

2
go.mod
View File

@@ -1,3 +1,3 @@
module github.com/taigrr/simplecolorpalettes
go 1.18
go 1.26