go-graphviz icon indicating copy to clipboard operation
go-graphviz copied to clipboard

lightgreen is not a known color.

Open ohkinozomu opened this issue 3 years ago • 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 https://github.com/goccy/go-graphviz/issues/42

ohkinozomu avatar Aug 15 '21 06:08 ohkinozomu