feat: 添加 颜色取反的功能
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user