Looking for examples of using Color toolbar item?

I am looking for examples to use the default color toolbar item for a macOS app using Xcode 11/12 swift 5.

Of course when I click on the color toolbar item the color adjust window window pops up but I don't know how to use it.

A simple example of say changing the color of a window based on the selection of a color from the color toolbar item.

Thanks
NSColorPanel uses the NSColorChanging protocol on the first responder. That's the general mechanism for most floating panels.
I CTLR dragged to the first responder and connected it to a @IBAction func but the action func never gets called when I select the color item in the toolbar? Do you or any one else have an example of how to do this or would you give me some more detail on the NSColorChanging protocol?

I have read the apple documentation on this and I am still not clear on how to do this?
The first responder isn't just a named item in Interface Builder, it usually refers to the receiver of nil-targeted actions, as described in Event Architecture
If you want to receive the protocol's message, your intended NSResponder must implement the method (likely in a subclass), then be in the responder chain when you change the color in the panel.
An example is an NSTextView subclass which changes its @backgroundColor according to the panel's current selection.
Looking for examples of using Color toolbar item?
 
 
Q