Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "github.com/teacat/noire"
  6. )
  7.  
  8. func main() {
  9. hue := 320.0
  10. val := 100.0
  11. sats := []float64{100, 70, 30, 10, 5, 0}
  12.  
  13. for _, sat := range sats {
  14. fmt.Printf("input: h=%.2f s=%.2f v=%.2f\n", hue, sat, val)
  15. c := noire.NewHSV(hue, sat, val)
  16.  
  17. r, g, b := c.RGB()
  18. rgbTxt := fmt.Sprintf("%d;%d;%d", int(r), int(g), int(b))
  19. fmt.Printf("\033[38;2;%smcolor %s\033[0m", rgbTxt, rgbTxt)
  20.  
  21. h, s, v := c.HSV()
  22. fmt.Printf(" h=%.2f s=%.2f v=%.2f\n\n", h, s, v)
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement