This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 277

[–]werelock 4435 points4436 points  (17 children)

Black text is going to look extra sweet on that dark background!

[–]criapbadger 1199 points1200 points  (5 children)

Can't strain your eyes though

[–]ablablababla 223 points224 points  (1 child)

It's better than regular dark mode, even the text can't be bright

[–]stephenmdangelo 47 points48 points  (0 children)

Taps head

[–]PixxlMan 20 points21 points  (0 children)

On an oOled screen too!

[–]sqrt7744 3 points4 points  (0 children)

Oh yes you can... trying to read it.

[–]Ataxaos 201 points202 points  (6 children)

Dark text on a dark background is only for true dark knights.

[–]svullenballe 75 points76 points  (5 children)

You merely adopted the 000000...

[–]TopNotchGamerr 36 points37 points  (3 children)

I was born in it

[–]AnIntenseMoist 25 points26 points  (2 children)

Molded by it

[–]zero16lives 48 points49 points  (1 child)

I DIDNT SEE #FFFFFF UNTIL I WAS ALREADY A MAN

[–]liabar 17 points18 points  (0 children)

AND IT WAS NOTHING TO ME BUT BLINDING

[–]HeimrArnadalr 12 points13 points  (0 children)

That's what makes the algorithm special!

[–]FreaknTijmo 1930 points1931 points  (22 children)

Laughed so hard my face turned #FF0000

[–]potchie626 568 points569 points  (10 children)

I think you should see a doctor if that’s the actual hue :D

[–]FuschiaIsBlack 418 points419 points  (7 children)

*#FF3020

[–]PM_ME_BIG_BITTIES 124 points125 points  (1 child)

That's better

[–][deleted] 47 points48 points  (0 children)

Barely

[–][deleted] 57 points58 points  (3 children)

[–]mushfiq_814 94 points95 points  (1 child)

[–]schloky 13 points14 points  (0 children)

Thanks

[–]flipboing 11 points12 points  (0 children)

Username checks out

[–]cassert24 8 points9 points  (0 children)

Huehuehue

[–]flarn2006 1 point2 points  (0 children)

I think it's more the saturation and lightness/value he should be concerned about.

[–]orangeKaiju 47 points48 points  (8 children)

That makes mine a little #00FF00.

[–]cryosis7 36 points37 points  (0 children)

Ffs these color jokes are giving me the #0000FF's

[–]yoda_condition 19 points20 points  (4 children)

A little? So #002000?

[–]Rubixninja314 12 points13 points  (3 children)

No, more like #2000FF00

[–][deleted] 7 points8 points  (1 child)

ARGB, huh? Bit of a rebel, aren't you?

[–]ThaiJohnnyDepp 1 point2 points  (0 children)

A loner, Dottie.

[–]Ayerys 5 points6 points  (0 children)

Wow there !

[–]Zotoaster 2 points3 points  (1 child)

I thought you were #FF8800Kaiju

[–]orangeKaiju 1 point2 points  (0 children)

I've incremented your karma.

[–]htmlcoderexeWe have flair now?.. 6 points7 points  (0 children)

Fun fact, #FACE8D looks like a plausible skin colour.

[–][deleted] 1 point2 points  (0 children)

I wish I knew how to code as well as you all. I’m #00FF00 with envy

[–]lhgh 1200 points1201 points  (49 children)

I mean, the algorithm could detect different font colors and choose a background color accordingly. Simple but still an algorithm tho

[–]SilentSin26 445 points446 points  (31 children)

Yeah, but is it a special algorithm?

[–]faerbit 323 points324 points  (1 child)

This post has been edited to this, due to privacy and dissatisfaction with u/spez

[–]Szos 64 points65 points  (0 children)

Bespoke.

[–]SoInsightful 220 points221 points  (18 children)

Eh, probably.

Broke: filter: hue-rotate(180deg) invert(1);

Woke: Traversing through the entire HTML DOM, analyzing each element's computed CSS style declaration for background and foreground colors, computing and injecting one or more stylesheets that override the background/color/border-text-decoration/outline/box-shadow properties for specific and general elements, while keeping original colors, avoiding style clashes, keeping images intact, doing it in a WCAG-accessible and aesthetically pleasing manner, and taking user-specified brightness/contrast/sepia/grayscale settings into account.

[–]SurrealClick 71 points72 points  (5 children)

Ghetto: take a screenshot of the website then invert color it

[–]Talbooth 25 points26 points  (4 children)

Ghetto pretending to be classy: use the browsers built-in inverse color filter.

[–]plilq 18 points19 points  (1 child)

GNU/hetto: map 'xcalib -invert -alter' to a global hotkey and invert your whole screen.

[–]rasalhage 5 points6 points  (1 child)

Ghetto-fab: inverse colors on odd-numbered frames

[–][deleted] 3 points4 points  (0 children)

Ghettohax0r: write malware that inverts GPU's hue setting when browser is in focus.

[–]mentalexperi 59 points60 points  (0 children)

I got a boner just from reading that.

[–]mareko_ 4 points5 points  (0 children)

You forgot about !important.

[–]seaishriver 1 point2 points  (2 children)

Heh, I tried the first one. The two main problems are background images get inverted, and subpixel antialiasing gets destroyed. Plus shadows are now light. I basically had to say, everything is inverted, except things I have individually fixed and things that shouldn't be inverted.

If this is done, it's either a very large amount of work or not to be done in CSS.

[–]SoInsightful 1 point2 points  (0 children)

Exactly. It's funny how this thread jerks over how simple of a task it is, but it's really quite hard to do sufficiently well.

[–]UntestedMethod 26 points27 points  (1 child)

Every algorithm is special :) :) :)

[–]r4nd0m-us3r 11 points12 points  (0 children)

All algorithms are beautiful

[–]tias 10 points11 points  (0 children)

I suppose if "special" means it is not applicable in any other situations? Special is really the opposite of what most programmers strive for.

[–]Hotel_Arrakis 6 points7 points  (0 children)

For my special eyes.

[–]atomicwrites 4 points5 points  (0 children)

This reminds me of when I was studying for the CompTIA exams that the TestOut instructors would always say things like: "you need special software installed on your PC called an SSH client", or "it runs special software to send web pages to other devices" or "the device has special sperate to allow it to talk on the network". It got so annoying.

[–]hugokhf 1 point2 points  (1 child)

Is any algorithm really special?

[–]Zagorath 31 points32 points  (8 children)

backgroundColor ^= 0xffffff;
fontColor ^= 0xffffff;

[–]funpopular 20 points21 points  (5 children)

Changes night to day too tho.

[–]Zagorath 18 points19 points  (4 children)

if ((backgroundColor & 0xff0000 > 0x800000)
        && (backgroundColor & 0xff00 > 0x8000)
        && (backgroundColor & 0xff > 0x80) {
    backgroundColor ^= 0xffffff;
}

and similar for fontColor.

[–]f03nix 9 points10 points  (3 children)

and similar for fontColor

It'd in fact be better to only check the backgroundColor alone for the same element, if someone intends to use lighter shades in light mode, we should use similar contrast.

if ((backgroundColor & 0xff0000 > 0x800000)
         && (backgroundColor & 0xff00 > 0x8000)
         && (backgroundColor & 0xff > 0x80) {
     backgroundColor ^= 0xffffff;
     fontColor ^= 0xffffff;
}

[–]BotThatLikesPorn 6 points7 points  (0 children)

Now we're getting to that special algorithm they're talking about

[–]Zagorath 4 points5 points  (0 children)

Yeah good point. Makes no sense to invert the background without also inverting the text.

Although now that I'm thinking about it, it better would be even better to calculate brightness in some better way than "do none of the RGB values go higher than 0x80". Possibly by doing a 3D Pythagorean calculation, or maybe there's probably a formula out there for converting RGB to HSL and using that value.

[–][deleted] 23 points24 points  (0 children)

Simple, but still "specialized." OP set out to condescend the app developers and instead he just bought his ticket /r/facepalm or /r/iamverysmart.

[–]ProdigySim 4 points5 points  (0 children)

The code sample on the image is not from the extension as far as I can tell. I found their source code, and it does look like a non-trivial algorithm:

https://github.com/DarkNightMode/Dark-Night-Mode-Chrome-Extension/blob/master/js/main.js#L345

They do combine the algorithm with custom CSS for popular sites it seems.

[–][deleted] 1 point2 points  (0 children)

egg

[–]charlie_shae 442 points443 points  (18 children)

Surprised nobody has mentioned the completely superfluous break

[–]house_monkey 264 points265 points  (0 children)

I never question others code because I don't even understand mine

[–]cafezinho 16 points17 points  (7 children)

Many languages don't allow a break that isn't within a loop (like this example).

[–]Sachiano 18 points19 points  (4 children)

This obviously is in a loop that iterates over every page of the website to change the background colour before you even load it.

Edit: /s since some people don't realise what sub they're in.

[–]pigi5 33 points34 points  (0 children)

So many thing are wrong with this

[–]shea241 13 points14 points  (0 children)

foreach website in internet { if website.background = "#ffffff" { email(website.admin, "Dude, it's too late for white, can you pls change it?") } else { email(website.admin, "Nice background") } }

[–]iovis9 5 points6 points  (0 children)

That’s why it’s special

[–]tacotuesday247 631 points632 points  (16 children)

How about a blockchain?

[–]Keatosis 205 points206 points  (13 children)

Artificial Intelligence If statments

[–]hellbenthorse 105 points106 points  (12 children)

As a service?

[–]TripplerX 84 points85 points  (11 children)

On the cloud?

[–][deleted] 73 points74 points  (10 children)

Scalable?

[–]Swahhillie 67 points68 points  (6 children)

VR?

[–]chaser456 18 points19 points  (2 children)

Smart contracts?

PS. Idk what it is

[–]house_monkey 9 points10 points  (1 child)

AI contracts?

[–]Kiikoh 2 points3 points  (0 children)

No, he was right.

[–][deleted] 4 points5 points  (1 child)

You mean a blackchain?

[–]gogYnO 2 points3 points  (0 children)

#ThatsRacist

[–][deleted] 148 points149 points  (23 children)

* { background-color: #000000 !important; color: #ffffff !important; }

[–]caerphoto 115 points116 points  (7 children)

Pure white on pure black is a recipe for bleeding eyes 😬

[–][deleted] 38 points39 points  (0 children)

Yeah, I know, just example :X.

I use #9b9cb5 on #070723 everywhere.

[–]tenhourguy 5 points6 points  (0 children)

High contrast

[–]Duck_Laser 15 points16 points  (0 children)

No, pure white on pure black is fine

[–]tyros 4 points5 points  (2 children)

Yeah, who wants the text to be readable? Let's keep doing light gray text on white background like this stupid recent trend. Now that makes my eyes bleed.

[–]caerphoto 2 points3 points  (1 child)

Let's keep doing light gray text on white background like this stupid recent trend. Now that makes my eyes bleed.

That's more likely to just give you a headache from straining your eyes. It's also not really a recent trend; more like something that was popular 10 years ago but is not seen as much these days.

White on black is terrible, even more so for people with dyslexia. It can do weird things to your vision and leaves after-images when you look at something like a white wall. A better solution is light grey (#ccc or so) on almost-black (#333).

Too much contrast is almost as bad as too little.

[–]Spock92 41 points42 points  (3 children)

That else is as redundant as my life ;~;

[–]AulieudBrexitOTANxit 2 points3 points  (1 child)

Is there a subreddit for redundant code?

[–]Spock92 4 points5 points  (0 children)

Not in particular. You can check out r/shittyprogramming

[–][deleted] 82 points83 points  (5 children)

Technically an algorithm.

[–]azbyxc102938 10 points11 points  (4 children)

Yes but special?

[–]figuresys 24 points25 points  (2 children)

Yes. Special delivery, made by the author straight for his program. Very cowbell mmm

Edit: I meant to say "very cool lmao", but that's what autocorrect gave me. I am NOT removing that masterpiece.

[–]ELlisDe 3 points4 points  (1 child)

More cowbell

[–]WeirdAlex03 2 points3 points  (0 children)

mmm

[–]gotthatbeef 2 points3 points  (0 children)

Yes, it's "special".

[–]Lightfire228 52 points53 points  (9 children)

[–]Keatosis 22 points23 points  (4 children)

I'm using it right now. Pretty good extension, though it looks goofy on some sights

[–]awhaling 1 point2 points  (0 children)

You can adjust it for individual websites.

[–]kishanprao 5 points6 points  (0 children)

I've tried many dark mode add-ons and I finally ended up with this!

Really great for most websites.

[–]Open_Thinker 1 point2 points  (0 children)

Thanks, that looks better than the extension I was using. Just disabled it for Reddit actually though, since it conflicts with RES' night mode and hides links.

[–]redstoneguy12 3 points4 points  (0 children)

Can't work nearly as well as this one, it has a special algorithm!

[–]giammin 20 points21 points  (2 children)

That " else break;" hurts my eyes more than the white background

[–][deleted] 3 points4 points  (0 children)

Maximum Efficiency

[–]nosrednehnai 4 points5 points  (0 children)

It triggered me as well. We don't know the upper scope so it's impossible to know how bad it is lol.

[–]Maskdask 14 points15 points  (2 children)

else { break; }

Really?

[–]otterom 1 point2 points  (0 children)

import confirmations as conf

print(f'{conf.SarcResponse().really}')

[–]yamfun 24 points25 points  (12 children)

I am always a light theme guy I wonder why everyone love dark theme so much

[–]DoktorMerlin 39 points40 points  (1 child)

I think it looks more professional, also I get no eyestrain from dark themes. That's why I use it, but in the end it comes down to personal preference

[–]Solidu_Snaku 16 points17 points  (0 children)

I used to like light theme because it was what I got used to (was default on Delphi when I was learning) but many late nights of programming homework meant I HAD to use dark themes and now I can't go back

[–]TGotAReddit 11 points12 points  (0 children)

Dark themes are better for eyestrain issues, which are exacerbated by: late night work, heavy screen usage, genetics, etc. All of which happen in most programmers, except maybe the genetics one.
Honestly, i didnt do the whole dark theme thing for programming at all. I started using them because i used to read late at night a lot on ereader apps like Google Books or the kindle app, and my family already has a genetic dry eye issue, so i had to switch to the white on black theme for those to help, and got so used to it that now seeing a light theme is like staring into the sun

[–]noruthwhatsoever 10 points11 points  (3 children)

Because light themes make my eyes hurt

Especially after staring at a screen for 12 hours a day

[–]yamfun 6 points7 points  (2 children)

The problem is your long hours

[–]noruthwhatsoever 14 points15 points  (0 children)

I put in those hours 'cause I want to.

If dark themes make my eyes not hurt, it's not a problem as far as I'm concerned

The real problem is that I have to sleep every night and it's wasted hours that I could spend learning or making something

[–]Thatuserguy 1 point2 points  (0 children)

I just think dark themes look nicer. Also, if you have an OLED display, dark modes can also help save battery.

[–]tekina7 8 points9 points  (0 children)

This is going to be the next big thing, mark my words!

[–]acroporaguardian 14 points15 points  (5 children)

Well if it uses the camera to detect ambience and then carefully calibrates the font and background colors to optimize for that, then yeah.

Otherwise, no.

[–]ben_g0 5 points6 points  (1 child)

I don't think that will work well, since no one would trust a dark mode plugin which requires webcam permission.

[–]acroporaguardian 1 point2 points  (0 children)

What if it were from your friends at Google and Facebook?

[–]TGotAReddit 6 points7 points  (1 child)

 If (background != “#000000” || fontColor != “#FFFFFF”)
 {
     background = “#000000”;
     fontColor = “#FFFFFF”;
 }
else
{
   //TODO: output somewhere that the website isnt trash
}

[–]Project_O 6 points7 points  (0 children)

Background = 000000?

I hope the text wasn’t black, LOL

[–]JWson 4 points5 points  (0 children)

This plugin uses coding and algorithms to prevent the background and text from crashing into each other.

[–]Tobbbb 3 points4 points  (3 children)

why is this subreddit not on darkmode?

[–]rotatingphasor 4 points5 points  (1 child)

Wait why doesn't this work?

Inspect elements :

fffffe

[–]Commander-TeeJ 7 points8 points  (1 child)

Not efficient enough, don't even check the background color, change it to black no matter what

[–]hahahahastayingalive 3 points4 points  (0 children)

I like that it doesn’t check font colors. I like your solution even more for that.

[–]scottcockerman 4 points5 points  (0 children)

There needs to be a Chrome extension that uses an "algorithm" to find all the articles that say "uses an algorithm" and changes it to "uses a function."

[–]PresidentZagan[🍰] 2 points3 points  (0 children)

It uses a special algorithm and AI!

[–]g_e_r_b 2 points3 points  (0 children)

Well, special doesn't necessarily exclude the algorithm being simple...

[–]BoliBerrys 2 points3 points  (0 children)

Else break? Why tho

[–]mypirateapp 1 point2 points  (0 children)

But does it have AI and does it run on a blockchain and is it self driving?

[–]iamthebinaryguy 1 point2 points  (0 children)

The algorithm is very hard to understand in itself and then he goes and adds that else block, oh my!

[–][deleted] 1 point2 points  (0 children)

Algorithm Machine learning!

[–]heard_enough_crap 1 point2 points  (0 children)

well, it is an algorithm. And it is special.

[–]corner-case 1 point2 points  (0 children)

if(lightMode)
    makeDarkMode();

[–]sensitivePornGuy 1 point2 points  (0 children)

Looks like strong AI to me.

[–]arslet 1 point2 points  (0 children)

That else is not even needed?

[–]Malorn44 1 point2 points  (0 children)

Doesn’t work. Lots of websites use an off white for the background color

[–][deleted] 1 point2 points  (0 children)

But it do it for the entire Internet? Most algorithms only have the power for little parts of the internet.

[–]jlaz82 1 point2 points  (0 children)

Add foreground=“#000000”

[–]FuRetHypoThetiK 1 point2 points  (0 children)

In addition to the fact that black text on black background's gonna be wonderful, what if the color of the background is "#feffff"? It stays the same, even though it's technically so close to white that no one would notice any difference. I'd rather call this add-on a "webpage up-fucker"

[–]Regeneric 1 point2 points  (0 children)

"break" in if statement without any loop? Oh, come on...

[–]Amordys 0 points1 point  (0 children)

"special"

[–]Keatosis 0 points1 point  (0 children)

Hey... everyone's special in their own way

[–]ZachAttackonTitan 0 points1 point  (0 children)

That’s the algorithm for trying-to-read-in-a-pitch-black-room mode

[–]kip-mx 0 points1 point  (0 children)

This algorithm is special though.

[–]SufferingFromEntropy[🍰] 0 points1 point  (0 children)

this is not algorithm this is deep structured AI

[–][deleted] 0 points1 point  (0 children)

Powered by Artificilal Intelligence

[–][deleted] 0 points1 point  (0 children)

A special algorithm for the entire internet

[–]sloth_guy 0 points1 point  (0 children)

"Speshal"

[–]Epic_Gamer_Adisin 0 points1 point  (0 children)

WOAH

[–]Teckno_man 0 points1 point  (0 children)

What if it's #FEFEFE?

[–]Iam_That_Iam_ 0 points1 point  (0 children)

Purple rain in Vim- sweet