package color_test import ( "fmt" "testing" "git.urbach.dev/go/color" ) func TestLCH(t *testing.T) { color.Terminal = true lchColors := map[string]color.Color{ "black": color.LCH(0.0, 0.0, 0), "white": color.LCH(1.0, 0.0, 0), "gray": color.LCH(0.5, 0.0, 0), "pink": color.LCH(0.75, 1.0, 0), "red": color.LCH(0.75, 1.0, 40), "orange": color.LCH(0.75, 1.0, 60), "yellow": color.LCH(0.9, 1.0, 100), "green": color.LCH(0.75, 1.0, 135), "blue": color.LCH(0.75, 1.0, 260), "cyan": color.LCH(0.75, 1.0, 210), "magenta": color.LCH(0.75, 1.0, 320), } for name, c := range lchColors { c.Println("█ " + name) } } func TestLCHSpectrum(t *testing.T) { color.Terminal = true color.TrueColor = true for chroma := range 4 { for lightness := range 21 { for hue := range 80 { l := color.Value(lightness) * 0.05 c := color.Value(chroma) * 0.05 h := color.Value(hue) * 4.4 col := color.LCH(l, c, h) col.Print("█") } fmt.Println() } fmt.Println() } }