I have this shape and I want to keep the left part black (exactly from the middle) while having the right part grey. Is this possible? If I don't join the lines, I don't get the sharp end that I want. If I do, I can't have two different colours.

enter image description here

  • problem is the answer is infinite in the effort to find the centre. you never can.
    – NRGBalance
    Commented Sep 9, 2019 at 13:25

3 Answers 3


Apply a gradient to the path stroke from black to gray and set each color location to 50%.

enter image description here


The gradient solution of @Danielillo is cool and easy, but like @Luciano I don't trust the sharpness of a gradient. I would suggest to use clipping masks like this:

  1. Select the object by left-clicking it.
  2. Press Ctrl / Cmd + C to copy the object.
  3. Press Ctrl / Cmd + F to paste the object in the same position.
  4. Draw a transparent rectangle which covers one half of the object.
  5. Hold down Alt + Shift and drag a copy of the rectangle covers the other half of the object.
  6. Select one of the copies of the object and one of the rectangles, right click and select Make Clipping Mask.
  7. Select the other copy of the object and the other rectangle, right click and select Make Clipping Mask.

Now you have two objects, each contained in its own clipping mask. You are now able to give the two objects different appearances.


The gradient solution works wonderfully for this particular case, but what if you want to get more creative on the slicing of the colors?

There may be more elegant ways to achieve it, but using the paste in front/back option to duplicate the element, and masking it off with clipping paths will give you fare more control over how the colors overlap one another.

  • Good one. Maybe even make it a symbol before duplicating, in case there needs to be some update to the path (maybe not in this case, but with a more complex object it might come in handy). Also I don't trust much gradient steps sharpness, I'd rather have well-defined edges.
    – Luciano
    Commented Sep 9, 2019 at 14:10

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