[Libreoffice-ux-advise] [Bug 156182] FORMATTING Automatic text color can be unreadable with darker cell colors

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jul 7 10:11:45 UTC 2023


https://bugs.documentfoundation.org/show_bug.cgi?id=156182

Heiko Tietze <heiko.tietze at documentfoundation.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |libreoffice-ux-advise at lists
                   |                            |.freedesktop.org

--- Comment #2 from Heiko Tietze <heiko.tietze at documentfoundation.org> ---
Most if not all automatic colors are set by checking whether the background is
dark. It is implemented in include/tools/color.hxx as 

bool IsDark() const
{
//  62 is the number that means it also triggers on Ubuntu in dark mode
    return GetLuminance() <= 62;
}

bool IsBright() const
{
    return GetLuminance() >= 245;
}

And luminance is sal_uInt8((B * 29UL + G * 151UL + R * 76UL) >> 8);

I wonder how this luminance value relates to your calculation, that apparently
is much better dealing with the contrast.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libreoffice-ux-advise mailing list