Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BasicUI] More contrast in dark mode #1831

Closed
dilyanpalauzov opened this issue Apr 9, 2023 · 17 comments
Closed

[BasicUI] More contrast in dark mode #1831

dilyanpalauzov opened this issue Apr 9, 2023 · 17 comments
Labels
basic ui Basic UI enhancement New feature or request

Comments

@dilyanpalauzov
Copy link

I use openHAB 3.4 and Basic UI in Dark mode with Firefox. This is a screenshot at the top level (outside of any groups)

base1

This is a screen shot of a group:

base2

To be able easily to perceive the text the contrast between text color and text background shall be high. In the first screenshot the contrast is low. In the second screenshot the text is lighter and therefore the contrast is better. In the sitemap file I have no settings which change the color on that particular items.

The second screenshot shows (on the left) a switch and on the right

Switch item=rd_manual mappings=[ON="Ръчно", OFF="Автоматично"] labelcolor=[OFF="green", ON="red"]
Setpoint item=rd_on_watts minValue=400 maxValue=3500 step=100

The UP and DOWN buttons, and the ON state (Ръчно) are displayed with black text on dark gray background. This has very low contrast and therefore is hard to read.

  • In the main sitemap (first screenshot, outside of any group) increase the contrast between text color and text background
  • In the Setpoint and Switch mappings=[ON="…", OFF="…"] items (second screenshot right half), and Switch without mapping (second screenshot left half) increase the contrast between text and background for the buttons.
@dilyanpalauzov dilyanpalauzov added the bug Something isn't working label Apr 9, 2023
@lolodomo
Copy link
Contributor

lolodomo commented Apr 9, 2023

I will try to customize the colors.

@lolodomo lolodomo added enhancement New feature or request basic ui Basic UI and removed bug Something isn't working labels Apr 9, 2023
@lolodomo
Copy link
Contributor

  • In the main sitemap (first screenshot, outside of any group) increase the contrast between text color and text background

I do not understand what is this case ? Is it outside any group or outside any frame ?
Can you provide a very small sitemap showing that ?
I have good contrast in my main sitemap page.
Maybe you are using an unexpected sitemap feature ???

@dilyanpalauzov
Copy link
Author

Sample zz.sitemap:

sitemap zz label="A3" {
    Text item=inv1_Battery_capacity
    Group item=r1_power label="1 Реле" visibility=[r1_online==OPEN] valuecolor=[r1_color=="green"="green", r1_color=="lime"="lime", r1_color=="red"="red", r1_color=="maroon"="maroon"] {
      Text item=inv1_Battery_capacity
    }
}

Main view
image

View of the group

image

In the first screenshot the contrast is lower than on the second screenshot.

I do not understand what is this case ? Is it outside any group or outside any frame ?

It is outside any group and I do not have frames.

@dilyanpalauzov
Copy link
Author

I do not use color picket and rollerbind. But for me it seems that dark blue on black background is low contrast.

lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 10, 2023
Applied to colopicker, setpoint and switch/rollerblind widgets.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 10, 2023
Applied to colopicker, setpoint and switch/rollerblind widgets.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 10, 2023
Applied to colopicker, setpoint, switch/rollerblind and switch/mappings widgets.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
@dilyanpalauzov
Copy link
Author

As far as presenting Groups is concerned, I realize now that in Light (“Default”) mode BasicUI shows a white background, when displaying Groups, and light gray background when not displaying groups (but top-level items). This might be the reason for the significantly lower contrast for the “main” items in dark mode.

lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 10, 2023
Applied to colopicker, setpoint, switch/rollerblind and switch/mappings widgets.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo
Copy link
Contributor

I think it is better now with the PR I submitted:
image

@dilyanpalauzov
Copy link
Author

Yes, it is better. I assume the above excerpt is for top-level items (not Groups, which were good).

Are the toggles now also better in dark mode?

lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 10, 2023
Applied to colopicker, setpoint, switch/rollerblind and switch/mappings widgets.

Also change the track color of the switch widget when state is OFF

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo
Copy link
Contributor

I just updated the switch toggle when in dark mode, look at the capture before/after in the PR.

@lolodomo
Copy link
Contributor

Yes, it is better. I assume the above excerpt is for top-level items (not Groups, which were good).

The changes apply to any frame in the main page and any group or sub-page opened from the main page.
I have not yet checked the particular case of the main page without any frame, which is the one apparently with less contrast if I follow you.

@lolodomo lolodomo changed the title BasicUI — low contrast in dark mode [BasicUI] More contrast in dark mode Apr 11, 2023
kaikreuzer pushed a commit that referenced this issue Apr 12, 2023
…ode (#1834)

Applied to colopicker, setpoint, switch/rollerblind and switch/mappings
widgets.

Also change the track color of the switch widget when state is OFF

Related to #1831

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo
Copy link
Contributor

lolodomo commented Apr 14, 2023

The background is not the same when there are frames or not.

Without frames:
image
image

With frames:
image
image

I agree that the contrast is low for texts when in dark mode and no frames. Looks more acceptable when in bright mode.
I am not sure the problem is only the background color because if the background is darker, it should look more contrasted and we notice the reverse. The problem could then be rather the text color, maybe it is not the same white or one is in bold and not the other. I will have to investigate more.

@lolodomo
Copy link
Contributor

lolodomo commented Apr 14, 2023

By inspecting the page with browser tools, I can see that the color of "Setpoint Temp" is rgb(97, 97, 97) in one case and rgb(192, 192, 192) in the other case. So the "white" is not the same in both cases and it explains the difference of contrast.

@lolodomo
Copy link
Contributor

Explanation found: the default color set at the highest level (body level) is "mdl-color-text--grey-700" and it is the same whatever the theme.
When there is no frame, there is no other color for texts set deeper in the document and this default color is then used. It is a grey, the same for bright and dark themes.
I have to find the best way to fix that. Should not be too much difficult.

lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 14, 2023
Use the same text color (depending on theme) as a frame was present.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Apr 14, 2023
Use the same text color (depending on theme) as if a frame was present.

Related to openhab#1831

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo
Copy link
Contributor

lolodomo commented Apr 14, 2023

With the proposed fix:
image

kaikreuzer pushed a commit that referenced this issue Apr 14, 2023
)

Use the same text color (depending on theme) as if a frame was present.

Related to #1831

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo
Copy link
Contributor

I close this issue, everything was covered by #1834 or #1842.

@lolodomo
Copy link
Contributor

I see now that the slider widget should be updated too

@dilyanpalauzov
Copy link
Author

I see now that the slider widget should be updated too

Shall this ticket be reopened?

@lolodomo
Copy link
Contributor

No.
But a new specific one could be opened.
If not, I have it in mind, so don't matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic ui Basic UI enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants