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

Marker symbol colour #31

Open
skeenp opened this issue Jul 6, 2018 · 1 comment
Open

Marker symbol colour #31

skeenp opened this issue Jul 6, 2018 · 1 comment

Comments

@skeenp
Copy link

skeenp commented Jul 6, 2018

As per the pull request which isn't getting too much love, it would be good to have the spec allow users to deal with colouring the marker symbol. Something like the following for consideration.

// OPTIONAL: default "555555"
// marker's text or symbol color
//
// value must follow COLOR RULES
"marker-symbol-color": "#555555",
@adamwight
Copy link

adamwight commented Aug 19, 2022

We looked at this problem briefly and it seems reasonable to simply pick white or black depending on whether the background color crosses a relative luminance of 0.5 0.179, following this WCAG formula:

L = 0.2126 * R + 0.7152 * G + 0.0722 * B

The threshold 0.179 was chosen by solving for a luminance where the contrast

(L1 + 0.05) / (L2 + 0.05)

to black is equal to the contrast to white:

(L + 0.05) / (0 + 0.05) = (1 + 0.05) / (L + 0.05)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants