-
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
Hi and thanks for this libary, it looks pretty useful! I generated a gradient over the hues 0 to 360 with the Hcl
function, and the output looks wrong. Using the Hsl
or Hsv
functions causes no problems. Here is my rainbow gradient:
The code I used to produce this image using a HTML file that I opened in my browser:
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"github.com/lucasb-eyer/go-colorful"
)
func main() {
var out = `<html><head></head><body>`
for hue := 0; hue < 360; hue++ {
col := colorful.Hsv(float64(hue), 1, 1)
r, g, b := col.RGB255()
out += fmt.Sprintf(`<div style="width:1000px;height:2px;`+
`background-color:rgb(%d,%d,%d)"></div>`, r, g, b)
}
out += "</body></html>"
err := ioutil.WriteFile(os.ExpandEnv("$HOME/tmp/rgbdebug.html"), []byte(out), 0644)
if err != nil {
log.Println(err)
}
}
Metadata
Metadata
Assignees
Labels
No labels