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?


3 Answers 3


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

  • Why do you say this is "hackish?"
    – o_O
    Commented Aug 21, 2012 at 2:52
  • Well I used the gradient tool to create something that, by the definition of a gradient, isn't really a gradient at all.
    – Brendan
    Commented Aug 21, 2012 at 3:53
  • Perhaps...but in web CSS a gradient is often used in such a way to create hard angles instead of soft fade. Wasn't saying it's wrong, it's +1 for a creative and most efficient answer, but I don't think it's hackish.
    – o_O
    Commented Aug 21, 2012 at 4:15
  • Clever answer! :-)
    – curious
    Commented Jun 17, 2014 at 12:19

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.

  • I didn't know how to split objects in half (I don't use Illustrator much) so thanks for that
    – jhocking
    Commented Aug 21, 2012 at 1:48
  • I just went into Illustrator to try this and noticed there is another tool that does the exact same thing as that Pathfinder step. Select the dividing line and go to Object>Path>Divide Objects Below
    – jhocking
    Commented Aug 21, 2012 at 3:20
  • Cool! Yeah I've been using Illustrator for years and I still pick up things along the way. It's good to share knowledge with people...thanks for sharing yours!
    – Brendan
    Commented Aug 21, 2012 at 3:55

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.

  • Thanks.. I have tried to do the clipping mask but it always either cuts the white side away.. I just cant get it to work the way I am used to in photoshop Commented Aug 20, 2012 at 19:14
  • The shape that becomes the clipping mask has all attributes removed by default (AI assumes it's only for clipping). Once the mask has been created, you can select it multiple ways and apply most all types of formatting. Any color/pattern applied to it's fill becomes the background for the clipped group. Commented Aug 20, 2012 at 21:20
  • This is not described that clearly. To do this the OP is meaning you need three objects. One in the back that is a solid color, copy that and change the fill to a different color, then copy that, scale it by 50% to cover one side of the middle object, then select the top and middle and create clipping mask. This is good stuff to know, but in this case it is probably the least efficient of all the answers.
    – o_O
    Commented Aug 21, 2012 at 2:56

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.