Forum moved here!

Home / How to customise colors for Light/Dark theme (Day/Night mode)

Johnsito_G

I am way sensitive to light and I read AT NIGHT, so the white background hurt my eyes.

Any chance to change things backwards, say the background that currently shows white, to be changed to black and the letters that currently are black to be changed to white (or any other color).

I went through the advance settings and I changed the colors but NOTHING happens so ??? I just don’t get it.

I wish you could PLEASE help me.

I like, the simplicity of your reader but your default settings are getting me blind and is not very friendly to customize (I have found out).

YOUR HELP WILL be GREATLY appreciated please.

Johnsito_G

After a long time and MANY trials, I did figure out how to do it. THANKS! Great PDF readers

It would be SOOOOO nice if a NEW product out of the marriage of Sumatra and balabolka (reader and creator of audiobooks out of PDF’s but not good with images).

So if both would be combined, it would be PERFECT.

KEEP IT UP!!! THANKS

xgorex

Hi,
It would be great to have a “Night Mode” option available on top of any PDF doc, somewhere.
I believe that most people knew/saw similar feature in many other applications. Essentially the “Night Mode” switches a) background to dark color (very dark or even black), and b) font color to light color (grey 10%, white could be too bright).
This option is valid for 1) people who read a lot and 2) during presentation (the “.” view option works somehow odd or does not work for me).
I have not found such option in Sumatra PDF, i hope i did not miss anything.

Best Regards, Andrzej.

GitHubRulesOK

on the second point

  1. during presentation (the “.” view option works somehow odd or does not work for me).

the B(black) or . shortcut is the way Powerpoint Blackouts the screen during a presentation, they are opposite to W(whiteboard)

There are a number of previous discussions on the “old forum” with reference to the -invert-colors command see these comments

q) Inverted image color: Why?

a) PDF doesn’t have a notion of text or background color.
https://web.archive.org/web/20180726052347/http://forums.fofou.org/sumatrapdf/topic?id=3185334&comments=2

Background color of pdf files

https://web.archive.org/web/20190808200650/https://forums.fofou.org/sumatrapdf/topic?id=3184849

Option To Invert Colors

https://web.archive.org/web/20190809155014/https://forums.fofou.org/sumatrapdf/topic?id=3184675&comments=5

NIGHT MODE READING VIEW

https://web.archive.org/web/20190808201048/https://forums.fofou.org/sumatrapdf/topic?id=3185219&comments=2

xgorex

Thank you for hints.
But these are kind of work-arounds.
I am voting here for a regular option.

BR. /A.

carloswm85

I add to this request. It’s a shame that this reader doesn’t have such option.

Terrine

I concur! It would be most helpful :slight_smile:

rudy

The best way to achieve a night mode would be to put in some preset colors for multiple themes. Common ones would be light (which is current standard), dark (which inverts colors), and an intermediate gray theme (ex. TextColor = #ffffff , BackgroundColor = #6e6e6e). This is just an opinion. An additional option would be to add a Custom where the user could input the hex values for desired colors. If someone were to put in bad color values so that nothing was visible, then they could reinstall or alter the Advanced Settings file.

JohnRob

I’ve been using Sumatra for some years and am overjoyed at the speed and simplicity…Love IT :smile:

I would like to request what I think would be a simple feature. I would like to have two sets of colors in the advanced settings file. Which is current would be selectable by some menu or keyboard combination.

This would allow me to have a dark theme for easy on the eyes reading. And a “normal” theme for magazines etc.

Thanks
JohnRob

GitHubRulesOK

@JohnRob
you can change SumatraPDF behaviour as you wish by having two shortcuts e.g. if you have one like the following
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -set-color-range #000000 #f000f0
you can change colour drastically like this, NOTE that #F000F0 (they are zeros) = no green

image

or use another shortcut to drag files to that has a darker grey (RRGGBB are all equal)
“C:\Program Files\SumatraPDF\SumatraPDF.exe” -set-color-range #F0F0F0 #000000

Resist increasing the left hand values to more than the right since you will get an inverted colour effect (see how the face colours are inverted from skin colours to blues)
image

The primary issue is that the page images (including text) are remaped to a different colour range, so if you say black is white then equally the reds become cyan, that is the nature of colour reversal.

Just to show the issue here are inversed files in the same 50/50 colour range session so note how the darker background shown on first page and bookmarks is inverted compared to the 50% washed out page which is easier to see in more natural tones in the dark and you could add some warm red to that page (NO unhealthy BLUE LIGHT at NIGHT)
image

So if the problem is night reading jars on your eyes Keep text Black and mute the paper colour to less blue and use a dimmer setting in the night light settings.

There is also the SEPERATE but related issue of how to use windows apps to change the peripheral window dressing so as to include darker elements such as scrollbars like this
image

which is covered in Changing the background and text color of tabs - #11 by GitHubRulesOK

JohnRob

@GitHubRulesOK

Thank you for linking me to the older thread. I had looked back some posts and could not find a similar one. Apparently I did not look far enough.

And thanks for the suggestion, I’ll give it a try but I’m not sure it will be much better than just editing the settings file as I open pdf’s 99% of the time by double clicking them.

John

GitHubRulesOK

@JohnRob
Actually back link was thanks to SumatraPeter

For your needs a similar issue was discussed on GitHub where I suggested running Find and replace text which should work in the background as you browse
see Feed in the settings file as a command line argument · Issue #1027 · sumatrapdfreader/sumatrapdf · GitHub

If you want to access internally from SumatraPDF menu you could add the two alternating values as Open in Dark Theme and Open in Light Theme in the files menu.

In this case you will need slight changes to the settings files, first find where your settings file is, portable users will usually keep it in the app folder, however most installations will keep it in the users AppData\Roaming folder. Easiest way is starting advanced setting and in notepad initiate “save as” that will confirm where the current settings are loaded from.

Place a copy of FART.EXE from FARTing the Easy Way - Find And Replace Text - Mikail's Blog in the same settings folder. Then also in that folder make two files by cut and paste the following with notepad

@%~dp0fart.exe -i -q %~dp0SumatraPDF-settings.txt "BackgroundColor = #F8F0F8" "BackgroundColor = #F0F0C0"
@copy %~dp0SumatraPDF-settings.txt %~dp0SumatraPDF-settings.tmp
@copy %~dp0SumatraPDF-settings.tmp %~dp0SumatraPDF-settings.txt

NOTE that is THREE lines where the first line does all the work, just make sure the #values are not the same. save the first file as say DARK.CMD (actually it is sort of a parchment colour). The extra two copy lines may seem daft however although the one line works when called from outside SumatraPDF (as it sees an external change), we will be using them from inside and SumatraPDF does not see a change at that time however we need to trigger it as if it changed the settings file. NOTE only time will tell if this is a problem later.

for LIGHT.CMD we just need to reverse the two values and save it so it looks like this

@%~dp0fart.exe -i -q %~dp0SumatraPDF-settings.txt "BackgroundColor = #F0F0C0" "BackgroundColor = #F8F0F8"
@copy %~dp0SumatraPDF-settings.txt %~dp0SumatraPDF-settings.tmp
@copy %~dp0SumatraPDF-settings.tmp %~dp0SumatraPDF-settings.txt

It is important we use the same alternating value so it acts as a simple switch (you can change them but always change them in pairs and see later that the .TXT file has either one to start) OK now for the fun bit in SumatraPDF-settings.txt ensure you have

UseSysColors = false

Otherwise the system themes will override our custom settings then under FixedPageUI

change the background value to EITHER of the ones we are currently using for example
BackgroundColor = #F8F0F8

now find the ExternalViewers section and change it with the correct location above to look something like this

ExternalViewers [
	[
		CommandLine = "C:\Users\**_your name_**\AppData\Roaming\SumatraPDF\dark.cmd"
		Name = Dark Theme
		Filter = *.*
	]
	[
		CommandLine = "C:\Users\**_your name_**\AppData\Roaming\SumatraPDF\light.cmd"
		Name = Light Theme
		Filter = *.*
	]
]

If your really adventurous you can add other lines to each theme.CMD to change the
MainWindowBackground = #80fff280
TextColor = #000000
avoid changing it too much unless you want an inverted theme, also if you are using the pre-release you could change the GradientColors margin as shown above

OR even flip e-pub user interface from true to false (but there is now a toggle switch in the debug menu to make that a no brainer)
if it all goes wrong simply delete the SumatraPDF-settings file and next time you will be back to a default setup (without a file history ) I did remind you to make a backup, somewhere else, didn’t I ?

Reater

In prelease hex code i see have “darker” word.
Do it have a way to reenable it?

ianas

I see nobody has mentioned the -invert-colors switch
just create a new shortcut
image

and use it when you want to use “dark mode”

Reater

i know that v.3.2.10638 have dark mode in menu that work good.
I not undstand why is abandoned.

kjk

The reason it was disabled was: the person who was working on it didn’t complete the work so it wasn’t done and there’s no one to complete the work.

Reater

It is a pity that nobody has taken care of it.
I think many users appreciate this feature.
However this function worked very well and could go as it was.

Perene

Is it possible to add a dark mode to this Windows software? To change how pages look like, adding a black background and white text? This is already possible in the Kindle app for iOS.

Usher

There are no easy to switch predefined settings for dark mode in SumatraPDF. However, you can change settings on your own - just go to Advanced Options in Settings menu and provide new values for TextColor, BackgroundColor and SelectionColor in FixedPageUI and EbookUI sections.

matrix

Perfect this works well! Thank you Usher