Inkscape or Illustrator: How to create a Polygonal Gradient / Shapeburst fill?

I’m trying to create a Polygonal Gradient fill in Inkscape or Illustrator. Here’s a rendered example of what I’m trying to do:

Polygonal Gradient on a pentagon

The image above shows a black-to-white polygonal gradient on a pentagon. As you can see, the gradient is neither linear nor radial. It follows the shape of the polygon: the color of each pixel is determined by its distance to the nearest border. The further away from any border the pixel is, the more of the “inner” colour (in this case: white) is used.

Can inkscape or illustrator do something like this? And, bonus question: can I somehow make this work for curve-based shapes too, such as a rounded rectangle?

It seems so very basic but I just can’t seem to do it.

EDIT: I just learned that Gimp has an option for bitmap-based graphics called “shapeburst”. It does exactly what I want – but only for bitmaps. This site has some nice examples. Here are the Gimp docs on this topic.

Answer

This is for Inkscape 0.92, and uses the Interpolate Extension, although something similar could also be achieved in Illustrator using a Blend.

  1. In Inkscape draw a pentagon, and fill it black, no stroke

  2. Copy and paste it in place

  3. Scale the copy to a small pentagon in the centre of the larger pentagon, and fill it white.

  4. Select both pentagons, and do Extensions > Generate from Path > Interpolate

  5. Set the Interpolation steps to something like 75, and other settings as shown, then click Apply

enter image description here

  1. Finally draw a black square over everything, and do Object > Lower to bottom

Example made in Inkscape

enter image description here

Attribution
Source : Link , Question Author : Alan47 , Answer Author : Billy Kerr

Leave a Comment