JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

[Bug]: Low contrast on table header sort arrow

Open MennoVink opened this issue 2 years ago • 0 comments
trafficstars

Detailed steps on how to reproduce the bug

  1. Set a juce::TableListBox's header's backgroundColourId to something dark like juce::Colour( 0x29, 0x27, 0x2d ).
  2. Populate the table with columns / contents
  3. Sort the table

What is the expected behaviour?

The sort arrow is clearly visible. Instead it has very low contrast because in juce_LookAndFeel_V2.cpp it uses a fixed Colour(0x99000000).

Personally i've had to change this to

        auto bgColour = header.findColour (TableHeaderComponent::backgroundColourId);
        if( bgColour.getLightness() < 0.5f )
            g.setColour (Colour (0x99FFFFFF));
        else
            g.setColour (Colour (0x99000000));

Perhaps this can be done in the main codebase as well, or allow the sort arrow color to be customized.

Operating systems

Other

What versions of the operating systems?

N/A

Architectures

Other

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • [X] I agree to follow the Code of Conduct

MennoVink avatar Apr 05 '23 11:04 MennoVink