Advice for creating a new JUCE component with "LookAndFeel Colours"


I’m creating a new set of components to add to my “palette” and I wonder which is the best way to design them to go well with the other JUCE components in terms of colour settings.

I guess that the standard way would be to create a set of colour ids such as:
enum ColourIds
buttonColourId = 0x1000100,
buttonOnColourId = 0x1000101,
textColourOffId = 0x1000102,
textColourOnId = 0x1000103

(example taken from TextButton)

however I’m not sure about how to choose the code for the component (what seems to be 0x10001000 here) not to interfere with the other components available and any new ones coming in a close future. Is there a list of all the component colour codes somewhere?

I’m also a bit confused with the findColour, setColour methods. Is it enough to create these colour ids at the Component level or I have to add them somewhere else too?

Most probably I could figure out everything by myself, but if anybody out here has already studied the topic or jules has a minute to spare, that would save me tons of time. Thanks much!


There's nothing special about them, they're just numbers - pick them randomly and they're very unlikely to clash with any existing ones!