{
const SVG = svg`<svg width="${w}" height="${h}">
<rect x="0" y="0" width="${w}" height="${h}" stroke="none" fill="white" />
</svg>`
const rc = rough.svg(SVG)
const addToSVG = el => SVG.appendChild(el)
addToSVG(rc.rectangle(0, 0, w, h, {
fill: palette[0],
fillWeight: 3.5,
fillStyle: 'sunburst',
hachureAngle: randInt(720),
stroke: 'none'
}))
thresholds.forEach((d, i) => {
addToSVG(rc.path(path(contour(contourData, i/palette.length)), {
roughness: 2.8,
fill: palette[i],
fillWeight: 2,
fillStyle: 'sunburst',
hachureAngle: randInt(720),
stroke: palette[i]
}))
})
return SVG
}