Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有办法检测网页的突出颜色?我的意思主要是使用 javascript 和 html5 的页面的背景颜色。
请注意,我主要考虑两种情况:1. 具有背景颜色的页面和 2. 具有背景图像的页面。
如果有人对这个问题有一些好的想法,我会非常高兴。
使用 jquery 查找标签的 valuebackground-color值。body
background-color
body
$("body").css("background-color")
对于网站上的所有元素:
$("*").each(function(e){ console.log($(this).css('backgroundColor')); });
成功了。
只需正确排序结果。
高温高压
格克斯塔