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

Document and possibly update guidelines for graphs #363

Open
RReverser opened this issue Apr 2, 2020 · 7 comments
Open

Document and possibly update guidelines for graphs #363

RReverser opened this issue Apr 2, 2020 · 7 comments
Labels
meta Issues involving the build process or the website itself, rather than its content

Comments

@RReverser
Copy link
Contributor

Sounds like we might want to update default colors for graphs (cc @tabatkins): https://twitter.com/tabatkins/status/1244695274338971649

We already have some templates for standard colors across the blog (cc @mathiasbynens), but it could be useful to document and update them explicitly in the repo.

Not sure if there is something we could do about existing graphs - is it possible to due color-shifting magic like we do for the dark theme (cc @tomayac) or would they need to be updated in bulk or would we need to just leave existing ones intact?

@mathiasbynens mathiasbynens added the meta Issues involving the build process or the website itself, rather than its content label Apr 2, 2020
@mathiasbynens
Copy link
Member

I think the graphs that use our standard colors (i.e. the ones we make in Google Sheets) are fine; Tab is talking about the screenshots from chromeperf, e.g. https://v8.dev/blog/pointer-compression#initial-performance. Yep, that's bad. Ideally we'd take the chromeperf data and turn it into a proper SVG using our standard colors.

is it possible to due color-shifting magic like we do for the dark theme (cc @tomayac)

I'd prefer not going this route. We should either fix the source images, or leave the old ones be and be more stringent about using our standard colors for all graphs in the future.

@RReverser
Copy link
Contributor Author

Yep, that's bad. Ideally we'd take the chromeperf data and turn it into a proper SVG using our standard colors.

Ah, I see, I thought it was about our regular graphs. This certainly reduces the scope of changes then.

@tomayac
Copy link
Contributor

tomayac commented Apr 2, 2020

For the image on v8.dev/blog/pointer-compression specifically, tweaking the hue-rotate fixes it:

invert(.862745) hue-rotate(120deg)

This should, however, indeed be fixed at the source.

@tomayac
Copy link
Contributor

tomayac commented Apr 2, 2020

Quick drive-by PR to fix /_img/pointer-compression/perf-octane-1.svg is up for merging: #364

@tabatkins
Copy link

The important bit is just that the lines aren't differentiated purely by hue (my red-green colorblindness is one possibility, but there are others), but also by lightness and/or pattern.

(And note that hsl's notion of lightness is a nonsense number that means nothing; it considers full blue and full yellow to have equal lightness, despite those actually being extremely far apart. You want the lightness used by actual monochrome, or by color spaces based on actual human vision like Lab/LCH. You can get a quick and dirty, but useful, approximation of this by taking the RGB value and computing (4*G + 3*R + B)/8.)

As such, I'm a little concerned about a hue-rotate being used here, as it adjusts the hue in HSL space, which again has absolutely no reasonable conception of "lightness" based on hue.

(It does indeed seem to work fine for this particular example, however; the colors are much more distinguishable to me now.)

@tomayac
Copy link
Contributor

tomayac commented Apr 2, 2020

(It does indeed seem to work fine for this particular example, however; the colors are much more distinguishable to me now.)

Happy it works. As a normally sighted developer, I tested my hack with @mathiasbynens' cool new DevTools feature B-) But again, you want to fix this on the source… Using pattern and color differences per line is IMHO the way to go.

@RReverser
Copy link
Contributor Author

Yep, that's bad. Ideally we'd take the chromeperf data and turn it into a proper SVG using our standard colors.

@mathiasbynens Would it make more sense / be possible to raise this upstream with chromeperf instead? I imagine Chrome might similarly have colorblind contributors who would appreciate more distinguishable graphs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues involving the build process or the website itself, rather than its content
Projects
None yet
Development

No branches or pull requests

4 participants