MCPcopy Create free account
hub / github.com/XIU2/UserScript / getColorValue

Function getColorValue

DarkMode.user.js:499–502  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

497
498 // 获取背景颜色值
499 function getColorValue(e) {
500 let rgbValueArry = window.getComputedStyle(e).backgroundColor.replace(/rgba|rgb|\(|\)| /g, '').split (',')
501 return parseInt(rgbValueArry[0] + rgbValueArry[1] + rgbValueArry[2])
502 }
503
504
505 // 判断当前是白天还是晚上

Callers 1

addStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected