Filling half a shape in Illustrator

I am still pretty new to illustrator, so I am still learning. I have a shape (pill shape) that is all white. I am trying to “fill” half of the shape with a yellow color (keeping the black stroke intact. Does anyone know how to go about this?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

This one is a bit hackish but it does the trick as well. Make a gradient where you have each color on either end, then click each little colored box under the gradient preview in the palette and set its location to 50. This way you’ve solved the problem but it’s all in one object.

enter image description here

Method 2

Start with your rectangle:

Start with object

Draw a line and use the Align palette to center it in the rectangle:

Draw line and center

Select both the rectangle and the line and use the Pathfinder palette to split the rectangle based on that line:

Split box

Delete the half you don’t want and then color the other one:

Delete half, color half

Use the Align palette again to line up your new colored box with the original one:

Stack objects

You’re left with two objects, but it does the trick.

Method 3

Build it as a clipping mask and put the half fill you’re after in it as a clipped object. Then you can apply a color to the mask to fill the other half with just the two shapes.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x