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

"Automatic" inner color #59

Open
julien-deramond opened this issue Dec 30, 2021 · 0 comments
Open

"Automatic" inner color #59

julien-deramond opened this issue Dec 30, 2021 · 0 comments
Labels

Comments

@julien-deramond
Copy link
Member

Inner color defined in statuses or templates is defined according to functional color, to highlight the inner. In the case of a dark functional color, the inner color is set to "white".

However in the case of "plain = false" or a gauge, the background is white and the border of the functional color => invisible inner.

→ Force the inner color to "black"

In Map Component:

At the same time, we would like to simplify the use of the component by setting the color of label/icon to white vs. black according to the background color of the marker.

Can be done according to the following algorithm (which is aligned with @mccart77 specifications for functional markers color):

  • Background Luminance = .3R+.6V+.1B
  • If Luminance >= 128 set the icon / label in black
  • If Luminance < 128 set the icon / label in white
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant