package color import "github.com/lucasb-eyer/go-colorful" type HueSat struct { Hue float64 `json:"hue"` Sat float64 `json:"sat"` } func (hs HueSat) ToXY() XY { return hs.ToRGB().ToXY() } func (hs HueSat) ToRGB() RGB { c := colorful.Hsv(hs.Hue, hs.Sat, 1) return RGB{Red: c.R, Green: c.G, Blue: c.B} }