Added OKLCH color space
This commit is contained in:
12
Color.go
12
Color.go
@ -5,18 +5,18 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Component is a type definition for the data type of a single color component.
|
||||
type Component float32
|
||||
// Value is a type definition for the data type of a single color component.
|
||||
type Value = float64
|
||||
|
||||
// Color represents an RGB color.
|
||||
type Color struct {
|
||||
R Component
|
||||
G Component
|
||||
B Component
|
||||
R Value
|
||||
G Value
|
||||
B Value
|
||||
}
|
||||
|
||||
// RGB creates a new color with red, green and blue values in the range of 0.0 to 1.0.
|
||||
func RGB(r Component, g Component, b Component) Color {
|
||||
func RGB(r Value, g Value, b Value) Color {
|
||||
return Color{r, g, b}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user