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