How can I get the value of colorwell control with interface builder?

I used interface builder to make a plug-in, and I used a colorwell control. How can I get the selected color in real time?

(I suppose you use python).
you can query the color well for its color value: colorWell.color().

You need to check Apples documentation for find out about the properties:

If you need to get notified when the color changes, this might help:

Thanks,but I’m sorry.I don’t understand much. If I use python, how can I get the color change in real time?

from AppKit import NSColorWell
colorWell = NSColorWell.alloc().init()

Access the chosen color at anytime with:


And close the Color Well window with:


Thanks, mekkablue.
I use the image this control in the xlb,I
click it and show the color selector, I want to know if this control has any monitoring events. It can monitor the colors I choose each time?

I see, that is a little more complex. You need to add an observer. Look at the second link @GeorgSeifert posted.

Sorry, I haven’t worked it out for a day today. Can you give me an example for how to add the observer to implement wiht python?Thank you!

Good that you ask. I was also stuck. Now I have a working sample:

Thank you very much. I’m sorry to have brought you so much trouble.:grinning: