Why when i apply:
content.document.documentElement.style.filter="invert(100%)"
to https://github.com/mozilla/pdf.js site
it not invert all colors?
how to invert all?
style not invert all
-
- Posts: 6427
- Joined: February 3rd, 2009, 6:29 pm
Re: style not invert all
Are you talking about the background color?
AFAIK, you can't invert the background color with a CSS filter.
e.g.
AFAIK, you can't invert the background color with a CSS filter.
e.g.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {
background-color: black;
color: white;
}
-->
</style>
</head>
<body>
<div>Example</div>
</body>
</html>
Code: Select all
content.document.body.style.filter = "invert(100%)";
-
- Posts: 10
- Joined: April 21st, 2015, 3:00 am
Re: style not invert all
I don't know why but when i add red or whatever valid color suddenly filter works on whole site.
Code: Select all
content.document.documentElement.style.backgroundColor="red";
-
- Posts: 6427
- Joined: February 3rd, 2009, 6:29 pm
Re: style not invert all
@greenenemy
Yes, that works on the GitHub page.
If you set the HTML background color, then you can invert the BODY background color, but not the HTML background color.
e.g.
Yes, that works on the GitHub page.
If you set the HTML background color, then you can invert the BODY background color, but not the HTML background color.
e.g.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html style="background-color: red;">
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {
background-color: black;
color: white;
}
-->
</style>
</head>
<body>
<div>Example</div>
</body>
</html>
Code: Select all
content.document.documentElement.style.filter = "invert(100%)";