Added HSL and HSV colors
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Eduard Urbach 2025-03-11 14:24:41 +01:00
parent b8b0fbb57e
commit afc4092824
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 153 additions and 48 deletions

View file

@ -3,12 +3,12 @@ package color_test
import (
"testing"
"git.urbach.dev/go/assert"
"git.urbach.dev/go/color"
)
func TestRGB(t *testing.T) {
color.Terminal = true
color.TrueColor = true
rgbColors := map[string]color.Color{
"black": color.RGB(0, 0, 0),
@ -24,17 +24,6 @@ func TestRGB(t *testing.T) {
}
for name, c := range rgbColors {
testColorRange(t, c)
c.Println("█ " + name)
}
}
func testColorRange(t *testing.T, c color.Color) {
assert.True(t, c.R >= 0.0)
assert.True(t, c.G >= 0.0)
assert.True(t, c.B >= 0.0)
assert.True(t, c.R <= 1.0)
assert.True(t, c.G <= 1.0)
assert.True(t, c.B <= 1.0)
}