221 9
Sign in to rate

Night Mode

0.03MB. Updated 2018-10-25. Supports both Anki 2.0.x and 2.1.x.

Description

This plugin adds the function of night mode, similar to the one implemented in AnkiDroid*. It adds a "view" menu with options like: - Automatic (i.e. at specified time) or manual switching of the night mode - Inverting colors of images or latex formulas - Defining custom color substitution rules It provides shortcut ctrl+n to quickly switch mode and a color picker to adjust background and text colors to your liking. After enabling night mode, add-on changes colors of the menubar, toolbar, bottom bars, and contents. When the option "Enable in dialogs" is ticked, it also changes colors of most of the dialog windows (like: 'Add card', 'Browser', 'Statistics', etc.). This add-on is Anki 2.1 compatible. If "force transparent latex" is enabled, new latex formulas should be generated with transparent background (delete old files to regenerate formulas created before). If you want to contribute, report a bug or translate the add-on to your native language, please visit the GitHub repository: krassowski/Anki-Night-Mode. Polite requests Please do not write bug reports on this page. It's a better idea to use this issue tracker (preferred) or e-mail: krassowski.michal@gmail.com If you find this add-on useful, please give it thumbs up, star it on GitHub and share it with others so more people can enjoy it and contribute :) Changelog Please note that the 2.x version of the add-on (and it's new features) is only available when running Anki 2.1.x == 2.2.3 - October 24, 2018 - Apply night_mode class to Overview and DeckBrowser for future compatibility with Review Heatmap 0.7 - Improve the white background workaround to handle text including bold elements == 2.2.2 - September 26, 2018 - Add German translation (by Is) - Improve the workaround eliminating white backgrounds after using "backspace", "delete", or pasting [...] == 2.0 - September 19, 2017 - new, rewritten addon, compatibile with Anki 2.1.x Beta 13+. == 1.2.3 - September 6, 2017 - bug fix: make text over difficulty buttons easier to read The full changelog is available here. Tips and tricks To modify colors on your cards further, you can utilize night_mode CSS class. For example, to modify color of clozes in night mode, use: .night_mode .cloze { color: red!important } Please use the follwoing links to see more examples and screenshots for: cloze color change, selective element background modification. Known issues - In the browser, the tag tree sidebar was observed to disappear when resized using Anki on Windows, which may (or may not) be related to changes made by this addon. Selectively disabling styling of the Browser (View -> Choose what to style -> untick "Browser") was reported to solve this problem. - At times some internal formatting breaks when pasting, cutting or entering a new line and causes edited line/text to appear completely white (issue #27). A workaround for that issue was included in 2.2 version. If you need help removing the white backgrounds, please see this issue (#18). Known issues from old versions - In some installations on Windows and Mac OS inversion of images & latex didn't work, however, it seems that this problem is resolved in Anki 2.1 completely. - Typing Korean and Chinese might be problematic - you can find some workarounds on this issue page. If you experience any of the issues above and know a bit about programming, please feel free to join the discussion on GitHub to help to fix these. Night-Mode integrates well with Anki-Zoom for 2.1 - don't forget to check it out! * The add-on is not affiliated with AnkiDroid. Installation of the add-on on your desktop will not affect how your mobile client works.

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into the desktop program:

1496166067

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

Other Anki 2.0.x Add-Ons Other Anki 2.1.x Add-Ons Ask a Question

Reviews

on 1545098713
It's a good plugin, that's all.
on 1544629686
Looks and works great.
on 1544329237
HEY DEV, I LOVE THIS APP BUT IT CRASHES!!!!! HELP!
on 1544012856
অসাধারন। Its night mode, and that's it
on 1543951407
Tnx, love this theme ^_^
on 1543743558
You can't style cloze deletion answers if you use this plug in. Other than that very good, but this was a deal breaker for me.
Comment from author
Yes, you can: https://github.com/krassowski/Anki-Night-Mode/issues/54#issuecomment-443502016
on 1543627853
Excelente para quem não gosta de muita luminosidade
on 1543613799
Buggy and poor/unclear selections
Comment from author
Hi there! If you've got a specific problem with the add-on, please explain it in detail so it could be fixed. Best
on 1542969242
Very good
on 1542909193
Lovely
on 1542853381
Great, has extra settings to change colours of text, etc. Good on the eyes.
on 1542668120
Everything needs a dark mode in 2018 and beyond. Glad to see something that adds anki to the list.
Now my eyes can rest a little while my brain is being flung to the walls (b>.<)b
on 1542555250
Would have been perfect if it was compatible with Power Format Pack add-on. You cannot view formatted texts properly in night mode. shame
Comment from author
I am sorry that it does not work for you. If you wish to report a problem with the add-on, please create a new issue, following instructions at https://github.com/krassowski/Anki-Night-Mode/issues. However, as per my understanding of how the Power Format Pack works, the issue might be actually caused by the power pack itself. If you could provide a reproducible example on the issue tracker, I would be happy to help and fix it.
on 1542115945
Wow, now I can set my Anki not only as "night mode", but also as I desire (for example, dark brown background and solid yellow text)!!
some notes for developers, if needed:
- if the background is light (for example, cyan or light grey), labels of decks still have the same colour and illegible (I know, that night mode wasn't supposed to use light back, so I'm smiling);
- the add-on's label of menu "view" isn't translated to the chosen main menu language and remains as English "view";
- maybe additional colours for every element (button, menu etc.)? (:blush-smile:)
on 1541506941
I love it!
on 1541066189
Lessens strains for night study. Overall a good addition to the program.
on 1540748319
Simple and easy. Looks fantastic. Thanks!
on 1540559376
Dude awesome!! You deserve at least the nobel prize for your night-mode themeing of anki!
on 1540510990
Looks rad
on 1540491047
Awesome update, thanks! Keep up the great work :)
on 1540145625
Great update thanks !
on 1539641716
Շատ լավ հավելում է: Ծրագիրը հաճելի տեսք է ստանում:
on 1539635615
Well done. And essential to work with Anki at night.
Lot's of useful configurations.
on 1539528023
funziona bene e lo stile black mi piace di più
on 1539520382
Looks much better than the default night settings I presume anki was getting from kde plasma and still fits with my theme.
on 1539107376
The design is pleasantly relaxing for the eyes. Thanks for the effort.
on 1538830175
It's really usefull to use at the night, i doesn't damage too much your eyes
on 1538544135
Simple and effective :)
on 1538000823
Looks great!
on 1537118532
At last, night mode on the desktop! No longer Android-only.
on 1537114474
This is awesome!
on 1536602165
Good!
on 1536352460
Very good for resting eyes. a lot thanks to the developers
on 1536341885
Cool!
on 1536167116
greagt
on 1535928109
Ooo! I like; I like.
on 1535922862
Works well!
on 1535534194
Looks great
on 1535489009
Thank you!
on 1535312189
I like night modes. This is a good night mode.
on 1535003000
Thank you immensely!

I really love this feature in AnkiDroid and now can happily enjoy using it in desktop version.
on 1534905682
Amazing!
on 1534712846
Very nice and polished. Congrats!
on 1534699084
Perfect!!!
on 1534127606
Great! Almost all parts working with a great appearance.
on 1532365699
ATTENTION FOLKS

If you have severe problems with staring at a bright computer screen, consider:
(a) increasing your intake of vitamin A (if your eyes hurt when you look at a computer screen, that is a telltale sign of vitamin A deficiency)
(b) installing the free software called Flux (download: https://justgetflux.com/) on your computer. The purpose of this software is exactly to make your eyes not hurt when you look at the computer screen. It does so by lowering the blue-spectre color of the screen (which is what causes the sensation of eye burning). Install Flux, then set it to lower the blue-spectre color of your computer screen: you will notice that the "eye burning" sensation magically goes away and you can use the computer normally.

The add-on is good and all, but I want to point those things out. :)

-----

Update: I just found out that there is a Chrome extension that does to every website you visit, what this add-on does to Anki — apply a dark theme. Pretty amazing! It's called "Dark Reader": https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh — Also for Firefox: https://addons.mozilla.org/en-US/firefox/addon/darkreader/
on 1532265578
Easy on the eyes.
on 1532218355
MAJOR BUG:

The left side browser menu is unusable. Cannot be expanded I only see a sliver of the menu
on 1531432008
good job
on 1530638159
awesome
on 1530438156
Makes the experience a whole lot better. Thanks.

note: Use Zoom 2.0 (2.1 404s)
on 1529945370
One of those addons that should be pulled into the official program.
on 1529777707
Thank you
on 1529367551
Fantastic. Works well with the Zanki deck and the Zoom add-on.
on 1529005879
Great
on 1528973660
something that should be there by default, but this also works, dark mode ftw
on 1528588800
Nice addon, much more confortable to do reviews with Night Mode enabled!
on 1527292800
Nice! For some reason, the text on my anki browser was extremely hard to see against a similarly light background -- now I can see stuff perfectly! It looks pretty nice, and is easy on the eyes.
on 1526947200
Your add-on saved my eye! Thanks!
on 1525824000
It rescues my eyesights.
on 1525651200
Just what I needed.
on 1525392000
Comfy
on 1524960000
Super cool at night :)
on 1524700800
2/5 incompatible with a lot of other add-ons. But my biggest complaints lies within not being able to select which deck to activate "night mode" on, and which deck not using night mode on, since it ruins the look of decks that use heavily CSS theming.
on 1524528000
Saves my sanity
on 1524441600
Aesthetically pleasing and easy on the eyes
on 1523923200
Useful
on 1523404800
Makes it a lot more pleasant to study these cards at night now
on 1522627200
Works as intended
on 1522627200
Very good!
on 1522108800
It works great.
on 1521849600
Handy.
on 1521244800
Well done!
on 1520985600
Nice black
on 1520985600
Perfect!
on 1520899200
helps my eyes
on 1520553600
cool
on 1520035200
I love this!
on 1519862400
Dark mode is what I love on my monitor.
on 1519257600
Thank you, my eyes aren't particularly fond of staring at the bright screen for long periods of time so this is very helpful!
on 1517702400
Very good, but is there any way to change the color of the "Extra Text" in cloze like Ankidroid does it (yellow on black)... Dark blue on black is unreadable, was able to change cloze text in code but can't find extra.
on 1517097600
Good extension, very useful!
on 1517011200
great
on 1516579200
Great Addon!

Only major bug I've been experiencing is that Anki Crashes when Syncing!
I have the zanki deck loaded (1gb), so this may play a part in it. If anyone/the dev know of a solution, please let me know!
on 1516233600
Perfect
on 1516233600
Does what is advertised and more. The color swapping is very useful for quick changes. I realise this is called Night Mode and all but with it's versatility could you implement themes/presets so a person can switch from dark to sepia etc on the fly.
Also thanks to the kind reviewer down below suggesting f.lux.
on 1516060800
Pair this up with https://ankiweb.net/shared/info/1333758373 and properly thank your eyes for all the hard work they do when you're at the computer.
on 1515974400
not working on beta 31 (anki 2.1) :(
still giving it a thumbs up
on 1515542400
Excellent! Just what my eyes needed.
on 1515456000
Great!
on 1515024000
Good
on 1514592000
This happened after using AnkiMobile iOS version. May be related or just a coincidence!

Switching night mode failed: Something went really really wrong.
Contact add-on author to get help.

Please provide following traceback when reporting the issue:
Traceback (most recent call last):
File "/Users/Library/Application Support/Anki2/addons/Night_Mode.py", line 598, in nm_on
File "/Users/Library/Application Support/Anki2/addons/Night_Mode.py", line 567, in nm_append_to_styles
File "aqt/deckbrowser.pyc", line 30, in refresh
File "aqt/deckbrowser.pyc", line 142, in _renderPage
File "anki/sched.pyc", line 261, in deckDueTree
File "anki/sched.pyc", line 246, in deckDueList
File "anki/sched.pyc", line 426, in _newForDeck
File "anki/db.pyc", line 76, in scalar
File "anki/db.pyc", line 43, in execute
InterfaceError: Error binding parameter 0 - probably unsupported type.
on 1513728000
Font colours keep getting messed up when editing existing notes.

For example, as I learn new kanji, I modify existing flash cards during my review to include the new kanji I have learned. When I do this I like to hit CTRL+Home and then press enter a few times to create space in the expression field of a flashcard for me to type words with updated kanji. I then paste these words into the original sentence, and reading. I then delete the extra unneeded characters. I have better luck doing this as I'm pretty picky with my furigana readings on my cards. If I do this with this add-on installed and enabled, the font colours get screwed up on my cards. When text should be white in night mode, it starts to show up as black, and when it should be black in night mode it shows up at white.

I un-installed because of this.
on 1513036800
Its works!
on 1512518400
The eyes refuse to work without this addon. Well done!
on 1512259200
Great looking dark theme
on 1511740800
love it !
on 1511740800
Gut fuer nacht lernen.
on 1511395200
Much needed.
on 1511395200
Great!!!!
on 1511222400
GREAT!
on 1510790400
It looks so much better! Would like more of these skins to make Anki feel less old school.
on 1510704000
very useful
on 1510704000
IT IS JUST AWESOME
on 1502928000
How to fix issues with multiple plugins

As someone else has mentioned in the reviews, other plugins do not always work well with this plugin.
The workaround for this is to edit the plugins. See menu bar: Tools>add ons>your addon>edit

Example #1: for a font plugin set font color 000000 (black) to ffffff (white)
(this worked with the plugin KanjiInfo)
Example #2: for a replay button plugin, set button color black to white
(this worked with the plugin Replay buttons on card)
on 1502409600
Nice add-on!

Converts the most frequently used parts of Anki to a nice dark theme.
I've had no issues when using it (stand-alone)
Thank you for maintaining this add-on!
on 1499990400
This is awesome!

Unfortunately it has minor issues with other plugins but it's completely fine.
on 1494288000
Beautiful

That's really beautiful. I love it.
on 1493424000
Thank you!

It's very useful , thank you author.
on 1491523200
Beautiful, but...

I am using the version from March 2017. I have experienced only two issues, so far:
1. If the file browser window is not maximized completely, the user is not allowed to resize and widen the left panel. When maximized, he is allowed to resize it, but still not as much as before installing your addon.
2. The first few drop-down menus on the left side of the screen look great, but the last few menus retain their original color scheme.
Some of this may be the fault of other addons conflicting with yours, but I noticed these things only after installing your addon, so I assume that it is because of your addon.
Thanks for your hard work: the rest is working well, and makes everything easier to read.
on 1488326400
Great except one problem

I've also found another bug. After creating new cards when using this add-on, when you're NOT using this add-on to study those cards, those cards are sometimes problematic: text with white color. You might think that's an empty card but try highlighting those empty space, you'll see the text.

========================================================================
When I am typing Korean while reviewing, the Hangul disappears after deleting a word. To illustrate this problem more clearly, I will use English as as example:
Type: " I am learning Korean.", after deleting the word "Korean", the whole sentence is gone unless I click away from the texting box and click back again.
This problem happens in other languages except English. Please fix this. Thank you very much:)
on 1487203200
Perfect!

That's what I was looking for!

Thanks man!
on 1485561600
The button's on the bottom are skewed

Gave this 3 stars pending a fix on the buttons that become large and skewed when night mode is activated during study. The "again, hard, good and easy" buttons are not visible at all. Also, the review card amount tracker is not enabled.
on 1484438400
THANK YOU!
on 1482278400
Perfect

Works fine.
on 1477267200
Amazing! So glad I found this add-on!

Does exactly what I've been trying to do for the past few weeks.

It lets me choose the background color, the text color, and I was able to go into the code and change the cloze color easily.

Thank you so much for this!
on 1472428800
Pretty good

YSK that you can use it to have different CSS in day mode and night mode. tag <body> has a class "night_mode", so you can use something like this to style other classes.

.q {color: #494a7f;} /* normal mode */
.night_mode .q {color: #a9aaef;} /* night mode */

Copying text from dialogues sometimes copies the the text colored, so that's a bit of a drawback
on 1464566400
Anki graphs

please add Night Mode for Anki graphs like this style. thank you.

http://s7.picofile.com/file/8253518984/Night_mode_graph.png
on 1463702400
Must have this one.

Takes care of your eyes.
on 1461283200
Looks awesome!

Smooth functionality and looks sweet. No more nighttime eye strain.
on 1457308800
Brilliant!

This theme is fantastic. Thank you.

Minor issue: the scrollbar in the Browser is still black.
on 1456790400
Almost perfect!

Almost perfect. That's exactly what I was looking for. There is a minor imperfection, though: the review buttons don't get highlighted when they have the focus, so you can't tell which button is currently selected,

Apart from that, great great addon! Don't forget to check the Enable In Dialogs menu check boxs as well!
on 1454112000
Excellent, almost perfect

This add-on has made my evening reviews much easier on the eyes and also more fun :) I noticed that there are still UI text elements that are black, such as the "+-" expand/contract to the left of each deck with subdecks. This being fixed, it would be perfect.

EDIT (1/29/2016): Thank you for the fix! It's perfect now!
on 1452902400
so great for protecting your eyes..........

I like this addon so much.......it really helps to protect my eyes.......thank you for your addon......it's very useful..........
on 1451260800
Amazing unless you use hyperlinks[Fixed]

Amazing now....
on 1450828800
could be great...

all of my cards contain LaTeX equations and it kind of defeats the purpose to go into Night Mode since it doesn't invert the color of the PDFs ... just get a bright white block with equation on a black background...
on 1448841600
Awesome.

I've been waiting for this kind of addon for so long. Thank you so much!
on 1448323200
Great!

This is one of my favorite add-ons :D
on 1444867200
Great

Does what the title says.
Very Nice! Missed this function before.
on 1438214400
invert image

Firstly, I would like to say "thank you" for developer of this add-on!
But I can invert image with this add-on actually!
Hope you can fix as soon as possible!
Thanks again!^^
on 1437868800
Very useful

I use it even at daytime because I hate bright light.
Some minor problem/s:
Usually buggy, especially when syncing Anki would sometimes crash (or maybe that's just me because I have a really large collection).
Doesn't work on some dialogs (browser, options, etc)
on 1434931200
Bug report.

https://anki.tenderapp.com/discussions/add-ons/4165-night-mode-add-on-bug
on 1433203200
Great for studying in the dark

I agree with my foretalkers: Great addon!

I also agree on the major drawback: Brower and Add-Dialog should be styled black too.

Another drawback is the missing ".night"-CSS-Styles, that are supported in AnkiMobile.

One Solution is to overwrite Anki's function for generating the card's html with one that also interprets the nm_state_on variable:

<code>
from anki.utils import isMac, isWin
from anki import js
import anki
from aqt import webview

def stdHtml(self, body, css="", bodyClass="", loadCB=None, js=None, head=""):
# this is new:
if nm_state_on:
bodyClass = bodyClass + " night"

if isMac:
button = "font-weight: bold; height: 24px;"
else:
button = "font-weight: normal;"
self.setHtml("""
<!doctype html>
<html><head><style>
button {
%s
}
%s</style>
<script>%s</script>
%s

</head>
<body class="%s">%s</body></html>""" % (
button, css, js or anki.js.jquery+anki.js.browserSel,
head, bodyClass, body), loadCB)

webview.AnkiWebView.stdHtml = stdHtml
</code>
on 1430870400
Great plugin

Great plugin. thanks for taking the time to write this.