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:
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.
-
In Inkscape draw a pentagon, and fill it black, no stroke
-
Copy and paste it in place
-
Scale the copy to a small pentagon in the centre of the larger pentagon, and fill it white.
-
Select both pentagons, and do Extensions > Generate from Path > Interpolate
-
Set the Interpolation steps to something like 75, and other settings as shown, then click Apply
- Finally draw a black square over everything, and do Object > Lower to bottom
Example made in Inkscape
Attribution
Source : Link , Question Author : Alan47 , Answer Author : Billy Kerr