tomoki1207 / vscode-pdfviewer

Show PDF preview in VSCode.
https://marketplace.visualstudio.com/items/tomoki1207.pdf
Other
307 stars 74 forks source link

Can't change color/backgroundColor #72

Open tomoki1207 opened 4 years ago

tomoki1207 commented 4 years ago

The preview is not supported to change color(text, background, ...).

Approaches

1. Can select a theme.

2. Can change each color.

Refs

22

49

hongshui3000 commented 2 years ago

I also want to be able to change the background color, the white background is too harsh

Fabian-Martinez-Rincon commented 2 years ago

were you able to change the background?

I also want to be able to change the background color, the white background is too harsh

hongshui3000 commented 2 years ago

The extension doesn't seem to provide this functionality.This is the reason I gave up using it to read a lot of documentation

kvnptl commented 2 years ago

The extension doesn't seem to provide this functionality.This is the reason I gave up using it to read a lot of documentation

Did you find any alternative extension which provides dark PDF viewer facility?

astral-shpx commented 1 year ago

I'm just a little annoyed as the showcase gif's got the dark theme

lamyergeier commented 10 months ago

Zathura PDF viewer lets us choose color theme as follows: (Solarized Dark Theme)

set default-bg                  "#073642" # base02
set default-fg                  "#93a1a1" # base1
# zathurarc-dark
# Refer: [zathura-solarized/zathura-solarized-dark at master · lennonwoo/zathura-solarized](https://github.com/lennonwoo/zathura-solarized/blob/master/zathura-solarized-dark)
set notification-error-bg       "#586e75" # base01  # seem not work
set notification-error-fg       "#dc322f" # red
set notification-warning-bg     "#586e75" # base01
set notification-warning-fg     "#dc322f" # red
set notification-bg             "#586e75" # base01
set notification-fg             "#b58900" # yellow

set completion-group-bg         "#002b36" # base03
set completion-group-fg         "#839496" # base0
set completion-bg               "#073642" # base02
set completion-fg               "#93a1a1" # base1
set completion-highlight-bg     "#586e75" # base01
set completion-highlight-fg     "#eee8d5" # base2

# Define the color in index mode
set index-bg                    "#073642" # base02
set index-fg                    "#93a1a1" # base1
set index-active-bg             "#586e75" # base01
set index-active-fg             "#eee8d5" # base2

set inputbar-bg                 "#586e75" # base01
set inputbar-fg                 "#eee8d5" # base2

set statusbar-bg                "#073642" # base02
set statusbar-fg                "#93a1a1" # base1

set highlight-color             "#657b83" # base00  # hightlight match when search keyword(vim's /)
set highlight-active-color      "#268bd2" # blue

set default-bg                  "#073642" # base02
set default-fg                  "#93a1a1" # base1
# set render-loading            true
# set render-loading-fg         "#073642" # base02
# set render-loading-bg         "#073642" # base02

# Recolor book content's color
set recolor                     true
set recolor-lightcolor          "#073642" # base02
set recolor-darkcolor           "#93a1a1" # base1
# set recolor-keephue           true      # keep original color
n2zl commented 7 months ago

Refer to https://www.cnblogs.com/yf-zhao/p/16127156.html/, I solved the problem in the following way. Open the file at: ~\.vscode\extensions\tomoki1207.pdf-1.2.2\lib\web\viewer.css Rewrite line 693 as: --body-bg-color: rgb(0, 0, 0); Add a line of code filter: invert(88%); in the following places: #sidebarContainer, #viewerContainer, #toolbarContainer

MAZ01001 commented 6 months ago

Open the file at: ~\.vscode\extensions\tomoki1207.pdf-1.2.2\lib\web\viewer.css\ Rewrite line 693 as: --body-bg-color: rgb(0, 0, 0);\ Add a line of code filter: invert(88%); in the following places: #sidebarContainer, #viewerContainer, #toolbarContainer

It seems to be enough to add #viewerContainer{filter: invert(1);} after line 813 (inside the @media (prefers-color-scheme: dark) block) to invert the PDF view colors (when system-theme is dark).

Could provide some user settings like James-Yu/LaTeX-Workshop color/invert-mode options of their internal PDF-viewer.

ricmli commented 5 months ago

Open the file at: ~\.vscode\extensions\tomoki1207.pdf-1.2.2\lib\web\viewer.css Rewrite line 693 as: --body-bg-color: rgb(0, 0, 0); Add a line of code filter: invert(88%); in the following places: #sidebarContainer, #viewerContainer, #toolbarContainer

It seems to be enough to add #viewerContainer{filter: invert(1);} after line 813 (inside the @media (prefers-color-scheme: dark) block) to invert the PDF view colors (when system-theme is dark).

Could provide some user settings like James-Yu/LaTeX-Workshop color/invert-mode options of their internal PDF-viewer.

#viewerContainer{filter: invert(88%);} perfectly fits my need, thank you both!