question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't invert dark pages

See original GitHub issue

I couldn’t find an existing issue for this.

Currently the extension seems to blindly invert all pages, even ones that are already dark. Example: https://www.cs.ru.nl/~freek/fta/xindex.html

Perhaps it could check whether colours are already sufficiently dark before inverting them?

I know about dark_sites.json, but I’m talking about automatic detection of dark pages.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RalphLeschcommented, Jan 10, 2018

I am working on a detection algorithm for dark pages, but it is not that easy, since it should be reliable and efficient for all/most pages. I got two approaches so far:

  1. Traverse DOM tree and determine background brightness of the biggest elements (which take the most screen space) and maybe foreground colors, too. Not that easy with transparency and possibly absolute positioned elements deeper in the DOM tree.
  2. Get pixel colors over screen. Probably randomly distributed over entire page for a compromise between accuracy and performance. But getting the image representation / pixel data of the page, like with captureVisibleTab, will probably already be too slow.

Currently, I am going for option 1, but the base is the same (color => brightness => dark/light), which I already got. If anybody has better ideas, I am thankful for suggestions or discussing the approach.

0reactions
irvnriircommented, Apr 5, 2021

I do not think this should be closed .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pages on MacOS and DarkMode. Documents re…
System Preferences > Accessibility > the Display tab > click "Invert Colors". This will give you white type on a black page. I...
Read more >
Dark mode for Chrome webpage content no longer inverts ...
Chrome is working on two different types of dark mode. The first one is an app-level theme that changes Chrome's title bar, new...
Read more >
Having browsers not invert colors on website in dark mode.
Hi,. My website is already dark with a black background and light color text. When enabling dark mode on some browsers that I...
Read more >
Turn on Dark theme & color inversion - Google Support
Dark theme applies to the Android system UI and supported apps. Colors don't change in media, such as videos. Color inversion applies to...
Read more >
Help – Dark Reader
It inverts the whole page and reverts some parts back. Requires GPU resources. ... The extension is fully open-source and has no obfuscated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found