As long as you want the division between colors to be a flat plane, you can use clipping planes to achieve this.