Cabbage Logo
Back to Cabbage Site

Drawing svg patterns

Hi everyone,

Is it possible to draw svg patterns like the following one into a image widget?

  <svg width="100%" height="100%">
    <defs>
        <pattern id="polka-dots" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse">
            <circle fill="#bee9e8" cx="50" cy="50" r="25">
            </circle>
        </pattern>
    </defs>
    <rect x="0" y="0" width="100%" height="100%" fill="url(#polka-dots)"></rect>
  </svg>

Here I really mean, drawing patterns using provided svg code and not loading a svg image.

The code above is from here: https://webdesign.tutsplus.com/tutorials/how-to-use-svg-patterns-as-backgrounds--cms-31507

I don’t think this is supported with the JUCE SVG parser. See this feature request:


This and more will be possible with the new webview widget. But it will still take some time before it’s ready for testing.

Ok. Thanks Rory! :beers: