refactor: 配置头部工具栏颜色.

This commit is contained in:
lijiahang
2024-01-11 11:25:32 +08:00
parent 34ebad0b5f
commit 8e03368e85
14 changed files with 122 additions and 116 deletions

View File

@@ -203,26 +203,6 @@ export function getUUID() {
});
}
/**
* 调整颜色
* @param color color
* @param range 正数越浅 负数越深
*/
export function adjustColor(color: string, range: number) {
let newColor = '#';
for (let i = 0; i < 3; i++) {
let c = parseInt(color.substring(i * 2 + 1, i * 2 + 3), 16);
c += range;
if (c < 0) {
c = 0;
} else if (c > 255) {
c = 255;
}
newColor += c.toString(16).padStart(2, '0');
}
return newColor;
}
/**
* 清除 xss
*/