feat: 添加 颜色取反的功能

This commit is contained in:
zhangyu
2021-12-08 14:45:15 +08:00
parent 69381b01bc
commit fc18190944
3 changed files with 12 additions and 6 deletions

View File

@@ -320,6 +320,12 @@ function randomcolor () {
return n()
}
export {
randomcolor
function ColorReverse (OldColorValue) {
const newValue = '0x' + OldColorValue.replace(/#/g, '')
const str = '000000' + (0xFFFFFF - newValue).toString(16)
return '#' + str.substring(str.length - 6, str.length)
}
export {
randomcolor,
ColorReverse
}