Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to colour along a path inside an object with a gradient...?

New Here ,
Dec 13, 2016 Dec 13, 2016

Hey everyone, first post. Sorry for the mouthful of a question.

I'm very new to Illustrator so I will try my best to explain what I want to do using this image:

example.jpg

I have this solid, square-swirl sort of object here and what I want to do is add colour to it. Not just a solid colour though. I want it to be a gradient that follows the path of the swirl starting with black at 1 and ending in red at 2. Is it possible?

Thanks in advance!

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Dec 13, 2016 Dec 13, 2016

Draw a spine path, apply a path gradient or respective art brush, use the shape as a clipping mask. A more convoluted alternative would of course be gradient meshes.

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

That sounds fairly straight forward. I should be able to figure that out!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2016 Dec 14, 2016

If your shape is a path outline, you could apply your black->red gradient to the stroke (no fill) and select the second stroke option in the gradient panel.

Screenshot 2016-12-14 09.25.16.png

To get the variable widths, you could play with the width tool or choose Object -> Path -> Outline Stroke and adjust the widths of your new shape (I chose the latter and got the shape to look like yours in under two minutes).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Sorry, I'm not sure what you mean by "if your shape is a path outline"? I'm really new so all these terms you experienced guys use are lost on me. My object is just a bunch of rectangles grouped together into a swirl. Then I went to Pathfinder and united them into a solid shape.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2016 Dec 14, 2016

You can use a path with a gradient applied to add the color to your shape.

First make the path, and make sure it's wider than the widest part of your shape.

Screenshot 2016-12-14 16.53.17.png

Add the gradient to the path (make the black color out of your red value plus black to avoid having the gradient fade out in the middle)

Use Make Mask in the transparency pallet to color your object.

Screenshot 2016-12-14 16.54.39.png     Screenshot 2016-12-14 16.54.59.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2016 Dec 17, 2016

What do you mean by "(make the black color out of your red value plus black to avoid having the gradient fade out in the middle)"?

I just applied a gradient to the stroke and then made the first gradient slider black and the second one red.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2016 Dec 17, 2016
LATEST

Jamil,

What do you mean by "(make the black color out of your red value plus black to avoid having the gradient fade out in the middle)"?

That if you are working in CMYK you should make the black a rich black, adding the full red (M+Y) value to the black (K) value.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2016 Dec 14, 2016

That's what I figured. A bunch of rectangles don't have direction in the way that a path does (e.g., lines drawn with the pen, pencil, line segment tool, etc.), which makes it tough to apply a directional gradient.

Mylenium's method (and SJRiegel's) of creating a path, applying a gradient, and then using your shape as a clipping mask would be your best bet.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 16, 2016 Dec 16, 2016

Hey guys, thanks for all the help. I made a spine path, made sure the path was wider than the widest part of my shape, and applied the gradient along the stroke of the path. Every time I click 'make mask' nothing happens. I'm sure its not as easy as just clicking the button and then everything magically falling into place... so I must be missing a step here.

Once my coloured path is sitting over top of my shape what do I need to do to make the colour apply to my shape?

Thanks again in advance!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2016 Dec 17, 2016

The shape needs to be the top object.

Please do also read the documentation:

How to use and edit clipping masks in Illustrator

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2016 Dec 17, 2016

Awesome! Thanks, I didn't realize my shape had to be on top.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines