Added OKLCH color space

This commit is contained in:
2024-03-06 00:18:51 +01:00
parent 13f4c5fb0f
commit 30838ca0b6
5 changed files with 151 additions and 35 deletions

View File

@ -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}
}