MidiKeyboardComponent becoming opaque in the dark


#1

Hey,
Today I was trying to display a MidiKeyboardComponent with alpha in the background when I found out it was becoming misteriously opaque at some point. This is the code:

void MidiKeyboardComponent::colourChanged()
{
    setOpaque (findColour (whiteNoteColourId).isOpaque());
    repaint();
}

Personally, I think that the “setOpaque (findColour (whiteNoteColourId).isOpaque());” line should be removed… It can be very confusing and for those seeking more efficiency the setOpaque method is always there…

What do you think?


#2

It’s possible to change the whiteNoteColourId by calling setColour on the component. You have full control over the opaqueness of that colour so you can also control the opaqueness of the MidiKeyboardComponent, right?