I’m developing a .NET library for generating DOT scripts and I’m trying to implement its logic in compliance with the Graphviz documentation as much as I can, but I don’t understand certain details. One of them is the color list interpretation logic when one color is missing.
According to what the documentation says on the fillcolor attribute, when a color is missing after a colon, the default color is used. So if I understand it correctly, fillcolor = “red:” should be interpreted as a gradient fill with the end color being the default color, but it isn’t.
I don’t really know what I’m doing, but I decided to play around with it. I’ve gotten it to work, with the exception that the default color is black and I’m not sure I can change it. (Defining color, bgcolor, and fillcolor have no effect. I’m guessing the reason you want this implemented is to define the default somewhere above the node.) It returns an error, but it does what you’d expect.
Instead of a null string for the second color, use basically anything else that isn’t a defined color. These all work (despite returning errors):
Thanks for your input. I noticed too that specifying anything but a null string after the colon makes it work somehow, but I thought that the default color should be the one that you get when setting the style to filled without specifying the fillcolor. In such case the color rendered is lightgray, so I would expect the default after the colon to be the same, but it is black, as you both noticed. So it turns out that there is probably some discrepancy between the documentation and the actual behavior of the visualization engine.