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

How to set `fillcolor` for kotlin DSL?

Open scarf005 opened this issue 2 years ago • 0 comments

fun <T : Comparable<T>> BinaryTree<T>.toGraphviz(): Graphviz =
    graph(directed = true) {
        node[
            Color.DARKSLATEGRAY,
            "fillcolor" eq "azure2",
            Font.name("Ubuntu Mono"),
            Font.size(20),
            Style.FILLED,
        ]
    }
        .addNode(this)
        .toGraphviz()

In this code, outline color can be set using Color.DARKSLATEGRAY, however I could not find a way to do the same for fillcolor, and had to use "attr" eq "value" notation.

Are there a way to set fillcolor the same way as color? Being able to use java.Color for fillcolor would be useful since "attr" eq "value" cannot type check.

scarf005 avatar Jan 02 '23 09:01 scarf005