radial gradient in new KDE

The new KDE Plasma releases require a slight change in your svg files, if you have a radiant gradient (no problems instead with the linear ones).

You have to specify the radialGradient cx, cy and r, like in the following example:

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient" cx="0.50" cy="0.50" r="0.45">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>

Because a svg with this other following code won’t work (will be invisible)

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *