Added HSL and HSV colors
This commit is contained in:
13
RGB_test.go
13
RGB_test.go
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user