How to customise NSSegmentedControl?

I am trying to build a custom color picker, similar to the one used in numbers and pages.


It looks like it is a NSSegmentedControl and I started with one with two segments. You can set the image of the right-hand segment to the color well but I cannot figure out to set the color of the right-hand segment or how to add a disclosure button to it.


I've subclassed NSSegmentedCell to override the draw method, but that always draws the full rect. There is no way to keep the shape of the button as well as the bezel.


I tried adding a subview to the NSSegmentedControl but that changes its behaviour and again results in a completely square view.


When I look at the composistion of an NSSegmentedControl using Debug View Hierarchy then I can see that the NSSegmentedControl is composed of NSSegmentItemViews which in turn contains an NSSegmentItemBezelView. It looks like these are the ones that I would ideally like to customize (eg. set the color of the NSSegmentedItemBezelView) but they are not part of the Cocoa API.


I've managed to get my own subview inserted between the NSSegmentedItemBezelView and NSSegmentedItemView but again, this gives me a square fill but with a faded button drawn over it (see image below).


I also got access to the NSSegmentedItemBezelView but only as a NSView which did not help.


Does anybody know how I can change the color of the segment to the left?