Added HSL and HSV colors

This commit is contained in:
2025-03-11 14:24:41 +01:00
parent 1b0b4cb28f
commit f75ff8da5a
14 changed files with 153 additions and 48 deletions

View File

@ -25,20 +25,22 @@ func TestLCH(t *testing.T) {
}
for name, c := range lchColors {
testColorRange(t, c)
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 {
c := color.LCH(color.Value(lightness)*0.05, color.Value(chroma)*0.05, color.Value(hue)*4.4)
testColorRange(t, c)
c.Print("█")
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()