Added OKLCH color space

This commit is contained in:
Eduard Urbach 2024-03-06 00:18:51 +01:00
parent d5335f4bad
commit f623fa2154
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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}
}