博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
opencv 图像黑暗_如何在黑暗模式下更改HTML图像URL
阅读量:2510 次
发布时间:2019-05-11

本文共 1333 字,大约阅读时间需要 4 分钟。

opencv 图像黑暗

Using CSS it’s pretty easy to apply changes if the system is in dark mode, using the prefers-color-scheme media feature.

如果系统处于黑暗模式,则使用CSS可以很容易地应用更改,使用prefers-color-scheme媒体功能。

Check my blog post on if you want to learn more about it.

如果您想了解更多有关信息,请查看我的博客文章。

Today I run into a problem - how to change an image defined in the HTML, rather than a CSS rule?

今天,我遇到了一个问题-如何更改用HTML而不是CSS规则定义的图像?

Turns out there’s a plain HTML way to do that, without any CSS or JavaScript involved.

事实证明,有一种简单HTML方式可以做到这一点,而无需涉及任何CSS或JavaScript。

We can use the picture tag to wrap the img tag:

我们可以使用picture标签来包装img标签:

If dark mode is supported and enabled, the dark.png image will be used as the source for the img tag.

如果支持并启用了暗模式,则dark.png图像将用作img标签的源。

The tag is very well supported, and old browsers that do not implement it, or do not implement dark mode, will fall back to displaying the light.png image.

很好地支持该标签,并且未实现该标签或未实现暗模式的旧浏览器将退回到显示light.png图像。

It’s important to note that the browser does not download 2 images, in any case: if it’s dark mode, in this example it will just download the dark.png image, and if it’s light mode, it will download only light.png, so there’s no waste of bandwidth.

需要特别注意的是,在任何情况下,浏览器都不会下载2张图像:如果是暗模式,在此示例中,它将仅下载dark.png图像;如果是亮模式,则仅下载light.png ,因此不会浪费带宽。

翻译自:

opencv 图像黑暗

转载地址:http://oomgb.baihongyu.com/

你可能感兴趣的文章
js封装设置获取cookie
查看>>
二值图像连通区域标记
查看>>
MVC in Javascript
查看>>
eclipse 创建的Android工程的结构
查看>>
第8章 Android异常与性能优化相关面试问题
查看>>
linux 定时备份文件夹
查看>>
有道单词导入 大量有道单词 生词本 批量导入 添加 有道单词XML 背单词
查看>>
jQuery Easing动画效果扩展插件
查看>>
bzoj 1002 [FJOI2007]轮状病毒 Matrix-Tree定理+递推
查看>>
Selenium WebDriver- 操作JavaScript的Alert弹窗
查看>>
娘的,自己的求逆序对模板又不好使了。。。。。。。。
查看>>
C#面向对象模式设计第十四讲:Template Method 模板模式(行为型模式)
查看>>
linux后台运行命令:&和nohup
查看>>
springboot + shiro学习(配置SecurityManager,Realm)
查看>>
http://desk.zol.com.cn/1600x900/
查看>>
Linux基础之命令练习Day3-文件管理:cat,tar,gzip,vim,ln
查看>>
iOS中使用nil NULL NSNULL的区别
查看>>
Hdu1754-线段树-单点更新
查看>>
在python中使用正则表达式(一)
查看>>
asp.net mvc 4.0的部署
查看>>