Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

circle

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.

stroke

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

final

(Note gradient strokes requires Illustrator CS6 or better.)

share|improve this answer
    
Very close, except that gradient is visible on single element. –  Michael Dec 14 '13 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 '13 at 17:39
    
I mean each element to have solid color instead of gradient. But all elements together form discrete gradient. –  Michael Dec 14 '13 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 '13 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 '13 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 );
}
share|improve this answer
    
thanks for the example script, Alex. –  Michael Dec 14 '13 at 18:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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