Closed RalfNorthman closed 4 years ago
Fill
type along the lines of FillNone | Fill Color | Reference String
? "pattern1"
from the above example and we add the "url(#...)"
in the typeToString
-function? Reference
or is something else more suitable?To reiterate I imagine the call would look like this: fill <| Reference "pattern1"
. Somewhere in raw svg-land it comes out something like style="fill: url(#pattern1)"
.
What do you think?
These are all the possible values that fill can take:
https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint
Also, according to the MDN, those apply both for fill and stroke:
https://developer.mozilla.org/ca/docs/Web/SVG/Content_type#Paint
This means that stroke and fill should accept exactly the same arguments, and that there are 5 types of values.
Can someone close this issue?
Yes, closing it - will publish a new version with this PR too.
That's out as 6.0.0. :+1:
The functions
fill
andstroke
can only takeColor
(andFillNone
in the case offill
) as an argument, but should be able to take references to gradients and patterns. I found this out when I tried to replicate this svg snippet:(http://tutorials.jenkov.com/svg/fill-patterns.html)
(of course you could do the svg reference with
TypedSvg.Attributes.style
, but I view that function more like a helper and escape-hatch than something to use on a regular basis in the actual API.)