openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
217 stars 238 forks source link

Some label/value colors have a low contrast ratio #1780

Closed mueller-ma closed 5 months ago

mueller-ma commented 1 year ago

Which UI are you reporting an issue for?

The problem

Some colors are quite bright, so the contrast ratio between them and the white background is low and thus hard to read. Example with labelcolor=["pink"]:

grafik

Your suggestion

This issue has been discussed and fixed in the Android app: https://github.com/openhab/openhab-android/issues/637

For the color names mentioned in the docs (https://www.openhab.org/docs/ui/sitemaps.html#label-and-value-colors) the app has a list with hexcodes for the light and for the dark theme to make sure a high contrast version is used: https://github.com/openhab/openhab-android/commit/68a0dc0c1d80ef5e17f8c97a09c9bb7ece49e421#diff-6e07de53fc6b88f960de082644106654b0ea82d22616dcfe3180a11f307d1625

The docs also mention this behavior:

Colors defined by a human-readable name may be adjusted for higher contrast, e.g. on a dark theme black may be displayed as white, because white has a higher contrast to the dark background compared to black.

lolodomo commented 9 months ago

It should be doable. I imagine to add an option to enable/disable this feature.

mueller-ma commented 9 months ago

We update the colors in the app for over 5 years now and nobody complained about it. So I'm not sure if a setting is required here.

Like for the "Inline SVG" setting it's IMO yet another setting a user has to think about it and get a worse user experience when not enabling it. I can't think of a situation where a user wants text that is hard to read, for example.

lolodomo commented 9 months ago

Some users will prefer to get exactly the color they set in the sitemap I am one of these users.

lolodomo commented 9 months ago

But I am ok to have by default a color remapping depending on theme for high contrast. So the new option can be enabled by default.

lolodomo commented 8 months ago

I will implement that as soon as the local settings stuff is done.

lolodomo commented 5 months ago

@mueller-ma : you forgot to cover 2 colours in Android app: pink and gold ? Or do you consider these two colours are fine with bright and dark themes without the need to remap them ?

mueller-ma commented 5 months ago

I added these two colors as "well-known" to the docs and Android app a few years ago: https://github.com/openhab/openhab-android/commit/e9bff16fc04f24d76c772e598de407d616c7f4e9