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

8
RGB.go
View file

@ -2,9 +2,13 @@ package color
import "math"
// RGB creates a new color with red, green and blue values in the range of 0.0 to 1.0.
// RGB creates a new sRGB color.
func RGB(r Value, g Value, b Value) Color {
return Color{r, g, b}
return Color{
byte(sRGB(r) * 255),
byte(sRGB(g) * 255),
byte(sRGB(b) * 255),
}
}
// inSRGB indicates whether the given color can be mapped to the sRGB color space.