Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Windows High Contrast Theme
Re: Windows High Contrast Theme
I have a different question about dark mode. How to get webpage's background color in dark mode? When browser enables dark mode, the background color is still RGB(255,255,255) which is read in js, but actually it is near to black color.
- salvadordf
- Posts: 4378
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Windows High Contrast Theme
Hi,
CEF doesn't expose any API call to read the background color in dark mode.
I guess there should be a way to read that value using JavaScript.
CEF doesn't expose any API call to read the background color in dark mode.
I guess there should be a way to read that value using JavaScript.
Re: Windows High Contrast Theme
But actually the value of background color read by js is the same no matter in dark mode or not.
The js code is:
The js code is:
Code: Select all
function getPageBackgroundColor() {
var body = document.body;
var style = window.getComputedStyle(body);
return style.backgroundColor;
}
console.log(getPageBackgroundColor());