How to fill radial array elements with gradient like this:

enter image description here

No idea how to make it happen automatically, rather than element by element.


2 Answers 2


Start with the flat pieces of the star. Make certain they are a compound shape by selecting them all and choosing Object > Compound Path > Make from the menu. (It doesn't matter what color they are.)

Now draw a circle which crosses roughly at the center of the shapes.


Change the stroke to be a gradient and very thick. Thick enough so all your shapes fall within the stroke's boundaries. And move it behind the shapes. You may need to rotate the circle itself so the gradient will start/stop between two of the shapes.


Select the shapes and the stroke and choose Object > Clipping Mask > Make.


(Note gradient strokes requires Illustrator CS6 or better.)

  • Very close, except that gradient is visible on single element.
    – Michael
    Dec 14, 2013 at 17:37
  • Not sure what that means. You can edit the gradient at any time. The gradient is visible on all elements it is merely more subtle on the other shapes. --> i.stack.imgur.com/6kGjw.png <-- if you want a different gradient, then make a different gradient.
    – Scott
    Dec 14, 2013 at 17:39
  • I mean each element to have solid color instead of gradient. But all elements together form discrete gradient.
    – Michael
    Dec 14, 2013 at 17:43
  • In that case, just fill each shape with a color tint. If that's all you want, you are over-thinking it.
    – Scott
    Dec 14, 2013 at 17:44
  • 1
    Another option -- Do it once in greyscale. Then Group and add a new solid color fill to the group via the Appearance panel and set the color fill's blend mode to Hue or Color. That way you merely need to change the flat color fill, the greyscale base will remain.
    – Scott
    Dec 14, 2013 at 19:50

You can script this sort of action with the scripting abilities built into Illustrator. It's not the most clear documentation, but it is quite powerful.

The ExtendScript Toolkit is an easy way to edit and test code on the fly rather than using a text editor and running with the File > Scripts > Run Script... Menu.

In your case, if the objects are ordered in your layer by their degree (clockwise or counter-), you can run through the array activeDocument.selection and change each item's fillColor property. I believe that you'll need to change each channel separately. You can either code-in the color values or interpolate between the first and last object's fillColors.

If you have a set of all blue (255, 0, 0) RGBColor objects, run:

// Setup your variables
var doc = activeDocument;
var sel = doc.selection;
var len = sel.length;

for (i = 0; i < len; i++) {
    sel[i].fillColor.red += ( ( 255 / len ) * i );
     sel[i].fillColor.green += ( ( 255 / len ) * i );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.