You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
310 B

  1. package color
  2. import "github.com/lucasb-eyer/go-colorful"
  3. type HueSat struct {
  4. Hue float64 `json:"hue"`
  5. Sat float64 `json:"sat"`
  6. }
  7. func (hs HueSat) ToXY() XY {
  8. return hs.ToRGB().ToXY()
  9. }
  10. func (hs HueSat) ToRGB() RGB {
  11. c := colorful.Hsv(hs.Hue, hs.Sat, 1)
  12. return RGB{Red: c.R, Green: c.G, Blue: c.B}
  13. }