setPaintMethod = (type, paint) => {
  // make a copy
  const p = new Paint(paint)
  svgCanvas.setPaintOpacity(type, p.alpha / 100, true)

  // now set the current paint object
  svgCanvas.setCurProperties(type + '_paint', p)
  switch (p.type) {
    case 'solidColor':
      svgCanvas.setColor(type, p.solidColor !== 'none' ? '#' + p.solidColor : 'none')
      break
    case 'linearGradient':
    case 'radialGradient':
      svgCanvas.setCanvas(type + 'Grad', p[p.type])
      svgCanvas.setGradient(type)
      break
  }
}
Set a color/gradient to a fill/stroke.
@function module:elem-get-set.SvgCanvas#setPaint
@param {"fill"|"stroke"} type - String with "fill" or "stroke"
@param {} paint - The paint object to apply
@returns {void}