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

Feature: Add darkmodes for pdf preview (in addition to "Match theme colors") #382

Open
MarcusAichmayr opened this issue Nov 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@MarcusAichmayr
Copy link

"Match theme colors" is a great and simple toggle to get pdf preview in darkmode. However, I found that the contrast could be higher if colors are used in the document. In my specific case, blue links were represented as light gray. This makes it difficult to distinguish links from the (white) text.

I propose alternative darkmodes that help with this issue. Here are some ideas what such darkmodes could achieve:

  • invert colors: This is a good way to keep the initial contrast and works well if many colors are present. This is present in some pdf viewers (like Gnome's default document viewer).
  • rotate hue: After simply inverting colors, we end up with completely different colors. (red -> cyan, yellow -> blue, green -> magenta) By additionally rotating hue by 180 degrees, darker colors will still be represented by lighter colors. Additionally, the color tone will end up similar to the initial color.
  • changing grayscale: While keeping contrast is good, one might actually prefer less contrast for a nicer experience. This can be achieved by adapting grayscale.

For instance, there could be the following modes:

  • match theme colors (already available)
  • invert
  • invert and keep colors (this is invert and hue rotate by 180 degrees)
  • invert and less contrast
  • maybe additional light modes

Note that Visual Studio Code's extension LaTeX Workshop offers several settings for manipulating colors of the previewed pdf. While I believe that such settings would contradict the design philosophies of Setzer, those settings might give ideas for the modes I mentioned or further modes. Here are the mentioned settings (populated with my current choice):

image

@cvfosammmm
Copy link
Owner

cvfosammmm commented Nov 22, 2023

Thanks for posting this info. I don't think we have to offer more than one extra mode though.

About the links: currently the whole page is converted to the theme's foreground color. But we actually know where the links are, so we might just color those rectangles in a different color, the theme's link color. That should solve this issue in most cases.

@cvfosammmm cvfosammmm added the enhancement New feature or request label May 14, 2024
@fcoelhomrc
Copy link

Also, can we leave images untouched?
Basically, skip color transformation for anything inside a \begin{figure} environment.

Sometimes, color inverted graphs become really hard to read, figures become weird, etc.

@cvfosammmm
Copy link
Owner

I don't think we should have more special casing. Also there's no easy way to detect those objects in a pdf. If something is hard to read, you can always turn off color matching temporarily..

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

No branches or pull requests

3 participants