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.
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:
- Select the object by left-clicking it.
- Press Ctrl / Cmd + C to copy the object.
- Press Ctrl / Cmd + F to paste the object in the same position.
- Draw a transparent rectangle which covers one half of the object.
- Hold down Alt + Shift and drag a copy of the rectangle covers the other half of the object.
- Select one of the copies of the object and one of the rectangles, right click and select Make Clipping Mask.
- 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.