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

Add color_dark to diagrams config to allow explicitly set chart colors in dark mode #163

Closed
JDJoe opened this issue Apr 27, 2023 · 7 comments · Fixed by #164
Closed

Add color_dark to diagrams config to allow explicitly set chart colors in dark mode #163

JDJoe opened this issue Apr 27, 2023 · 7 comments · Fixed by #164
Labels
bug Something isn't working
Milestone

Comments

@JDJoe
Copy link

JDJoe commented Apr 27, 2023

skin.conf

    [[diagrams]]
.... 
                        observation = "extraTemp3"
                        color = "#e69138"

Has no effect on the line colour on the chart.

added same colour code to # Observation specific settings. block.
Same result. Not change. Line is white.

@JDJoe JDJoe added the bug Something isn't working label Apr 27, 2023
@Daveiano
Copy link
Owner

Ok, some more Info needed here.

This could be either:

a) a real bug
b) Are you viewing the page using dark mode? If so, does your defined color showing up when switching to light mode? There is a logic implemented in dark mode, which checks if the color contrast between the dark background and the color of the chart line has a good enough color contrast. If not. the color is lightened up in dark mode, perhaps thats the case here?

@JDJoe
Copy link
Author

JDJoe commented Apr 28, 2023

There is a logic implemented in dark mode, which checks if the color contrast between the dark background and the color of the chart line has a good enough color contrast.

WTF!? LOL. Why!?
Colours do show up on light mode and would look perfectly fine on dark mode.
It's not for the code (coder) to decide what colours I can or can not use. How can I deactivate this "feature"?

Edit: Here is what gets hidden by "logic" you mentioned: #ffc000
Obviously, this logic is utterly flawed. :)

@JDJoe
Copy link
Author

JDJoe commented Apr 28, 2023

I took colour codes from diagrams that work.
The result is no different - white lines in dark mode, coloured in light mode.

I guess the problem is somewhere else.

@Daveiano
Copy link
Owner

WTF!? LOL. Why!?

Because a lot of the colours won't look good on the dark background in dark mode, and that's the best case. A dark red line of the line chart is badly seen on the background in dark mode. Because of that, the skin lightens colours up in dark mode to make them better visible. The feature evolved from a request of a color-blind person.

Colours do show up on light mode and would look perfectly fine on dark mode.

No, like I said because of the above reasons.

It's not for the code (coder) to decide what colours I can or can not use. How can I deactivate this "feature"?

Sorry, that's currently not possible. I would propose making it possible for the user to override this behaviour by defining a second config line like this:

[[diagrams]]
    .... 
    observation = "extraTemp3"
    color = "#e69138"
    color_dark = "#e69138"

What do you think about that?

@Daveiano Daveiano changed the title [BUG] colour is ignored [BUG] colour is ignored in dark mode Apr 28, 2023
@JDJoe
Copy link
Author

JDJoe commented Apr 29, 2023

Where did this color_dark come from?

We couldn’t find any code matching 'color_dark' in Daveiano/weewx-wdc

Colours do show up on light mode and would look perfectly fine on dark mode.

No, like I said because of the above reasons.

#ffc000 looks fine. Your code is flawed.

@JDJoe
Copy link
Author

JDJoe commented May 1, 2023

color = "#ffc000"
color = "#92b6f0"

I tested this on 3 browsers - Firefox, Chromium and Brave - on desktop and also Firefox in Android.
Only one showing coloured line for extraTemp2 and extraTemp3 is mobile phone.

Maybe your style sheets are screwed or that CCP style "logic" thing has gone off the rails.

@Daveiano
Copy link
Owner

Daveiano commented May 1, 2023

Where did this color_dark come from?

I just proposed it, it is not yet implemented into the skin.

@Daveiano Daveiano added this to the 3.2.0 milestone May 1, 2023
@Daveiano Daveiano changed the title [BUG] colour is ignored in dark mode Add color_dark to diagrams config to allow explicitly set chart colors in dark mode May 1, 2023
@Daveiano Daveiano linked a pull request May 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants