goccy/go-graphviz

lightgreen is not a known color.

ohkinozomu opened this issue · 0 comments

version

v0.0.9

sample code

package main

import (
	"bytes"
	"log"

	"github.com/goccy/go-graphviz"
	"github.com/goccy/go-graphviz/cgraph"
)

func main() {
	g := graphviz.New()
	graph, err := g.Graph()
	if err != nil {
		log.Fatal(err)
	}

	t, err := graph.CreateNode("test")
	if err != nil {
		log.Fatal(err)
	}

	t.SetFillColor("lightgreen")
	t.SetStyle(cgraph.FilledNodeStyle)

	var buf bytes.Buffer
	if err := g.Render(graph, "dot", &buf); err != nil {
		log.Fatal(err)
	}
}

output

2021/08/15 15:54:00 lightgreen is not a known color.
exit status 1

Probably this is because color_names is outdated.
https://gitlab.com/graphviz/graphviz/-/issues/1446
https://gitlab.com/graphviz/graphviz/-/commit/ae160d36572253aa4edfdb14fefe2729bbdfc771

related in #42