Selected text colour

Hey Jules -

What dictates the colour of highlighted texts?

I recently settled on black backgrounds for the labels in a project … but when the text is highlighted it is also black … clearly no good.

Is there a way to specify the text and background colours for “allSelectedText” or something like it ?

If you edit a label, it shows a texteditor. So you probably need to set the TextEditor::highlightedTextColourId colour.


Ah! Of course - can’t believe I didn’t think of that.

However - I also notice that the constructor for Labels hard codes a few colours:

Label::Label (const String& name,
const String& labelText) : …
setColour (TextEditor::textColourId, Colours::black);
setColour (TextEditor::backgroundColourId, Colours::transparentBlack);
setColour (TextEditor::outlineColourId, Colours::transparentBlack);

textValue.addListener (this);


So that you then need to individually set the colour for the label, instead of being able to use the lookAndFeel default colors.

Wouldn’t it be better to have this constructor look up the default textColourId instead of using black?