Closed dmi3kno closed 4 years ago
It seems like the package is translating colors from R to SVG literally. It works for most colors, but not all. This for example returns black square
library(minisvg) doc <- svg_doc(width = 100, height = 100) doc$append(stag$rect(x = 0, y=0, width=70, height=70, fill='violetred')) doc$show()
While it should be
rgb(t(col2rgb("violetred")), maxColorValue = 255) #> "#D02090"
I think round-tripping the color names like that can help fix those corner cases where colors do not get properly matched.
Fixed in 5725818fd
If the user specifies a colour which is an R colour, but not a CSS colour, then it will be converted to a hexcolour.
It seems like the package is translating colors from R to SVG literally. It works for most colors, but not all. This for example returns black square
While it should be
I think round-tripping the color names like that can help fix those corner cases where colors do not get properly matched.