mirror of
https://github.com/taigrr/simplecolorpalettes.git
synced 2026-04-01 20:49:11 -07:00
3d35bdf7005f00fb116d20db56c471893462d704
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
DO NOT USE
This repo is far from ready. The goal is to eventually have a ton of color palettes ready for use in go-colorhash or other color libraries. However, to keep the library as small as possible, all colors will be stored in integer format, and it is on the user to load them into a color library (such as the color package in the standard library).
Pulling in as many sources for color palettes is a time-consuming process, especially when many colors have names, but most do not, etc.
*EXPECT THE API TO CHANGE DAILY UNTIL v1.x.x IS RELEASED!
Languages
Go
99.7%
templ
0.3%