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

cmd/compile: add a dark mode for GOSSAFUNC html output #34325

Closed
agnivade opened this issue Sep 16, 2019 · 10 comments
Closed

cmd/compile: add a dark mode for GOSSAFUNC html output #34325

agnivade opened this issue Sep 16, 2019 · 10 comments

Comments

@agnivade
Copy link
Contributor

@agnivade agnivade commented Sep 16, 2019

What version of Go are you using (go version)?

$ go version
go version go1.13 linux/amd64

It would be very helpful to have a dark mode switch for the GOSSAFUNC html file. Staring at the white screen for a long time at night is stressful to the eyes.

Just an inverted color scheme with the proper highlight colors and a checkbox at the top to toggle scheme should be good enough.

Marking it as help wanted, as it's a good started issue for anybody looking to contribute. The relevant code is in this file - https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/html.go

@ysmolsky

@robpike
Copy link
Contributor

@robpike robpike commented Sep 17, 2019

If your screen stresses your eyes, your brightness is set too high. I prefer a light background but the background brightness is comparable to the rest of the room. This is the way things should be set up, so your eye accommodates equally to the screen and the environment.

I'm not in favor of dark mode but I know I am in the minority. Research shows it causes more eyestrain than properly set up light backgrounds. I do not expect to win this argument.

@josharian
Copy link
Contributor

@josharian josharian commented Sep 17, 2019

I have also had problems particularly with ssa.html. I subscribe to the “turn down the monitor” and “use red shifting” philosophies, but ssa.html is peculiarly bad.

Just switching away from programmer white to a gentler background color might help a lot.

Also, some of the highlight colors get lost or muddled when red-shifted. I have no idea how to fix that. Colors are subtle.

@agnivade
Copy link
Contributor Author

@agnivade agnivade commented Sep 17, 2019

I have already done all of that. Low brightness, red filter (had been using f.lux but switched to redshift couple of years back).

But I recently started to use the dark reader chrome extension, and everything seems so easy on the eyes at night. I do realize it's a personal choice at the end of the day. That's why I suggested a small opt-in switch for people who want to use it. No harm in that :)

Also, some of the highlight colors get lost or muddled when red-shifted.

I have been using redshift for a while now. Never had an issue with the highlight colors. So I think a new set of colors for the dark background should not be an issue.

@ALTree
Copy link
Member

@ALTree ALTree commented Sep 17, 2019

Since the file is viewed using the browser, wouldn't a dark mode browser extension also work?

@agnivade
Copy link
Contributor Author

@agnivade agnivade commented Sep 17, 2019

It doesn't work. I don't know why. But even if it did, it's just a generic solution. It won't have bg-specific highlight colors. I would like the ssa.html itself to have a dark mode switch.

@bradford-hamilton
Copy link
Contributor

@bradford-hamilton bradford-hamilton commented Feb 20, 2020

Hey yall, I'm going to start working on this!

@josharian
Copy link
Contributor

@josharian josharian commented Feb 20, 2020

Awesome. Ask if you have questions. One item of note: It is an explicit goal that ssa.html is a single, standalone file—so go ahead and slap all that css and goo right into the html head. :)

@bradford-hamilton
Copy link
Contributor

@bradford-hamilton bradford-hamilton commented Feb 20, 2020

Thanks @josharian, will do. Yes, it seemed like a really intentional decision - I will follow suite with the rest of the file.

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 20, 2020

Change https://golang.org/cl/220260 mentions this issue: cmd/compile: Add a dark mode to ssa html generation which can be toggled

@bradford-hamilton
Copy link
Contributor

@bradford-hamilton bradford-hamilton commented Feb 20, 2020

Okay, just submitted a patch for this - let me know if it's what you all were thinking!

@gopherbot gopherbot closed this in 1e9665d Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.