Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "github.com/teacat/noire"
- )
- func main() {
- hue := 320.0
- val := 100.0
- sats := []float64{100, 70, 30, 10, 5, 0}
- for _, sat := range sats {
- fmt.Printf("input: h=%.2f s=%.2f v=%.2f\n", hue, sat, val)
- c := noire.NewHSV(hue, sat, val)
- r, g, b := c.RGB()
- rgbTxt := fmt.Sprintf("%d;%d;%d", int(r), int(g), int(b))
- fmt.Printf("\033[38;2;%smcolor %s\033[0m", rgbTxt, rgbTxt)
- h, s, v := c.HSV()
- fmt.Printf(" h=%.2f s=%.2f v=%.2f\n\n", h, s, v)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement