mirror of
https://github.com/ChenQihan666/Lolia-Nodes-Status-Pages.git
synced 2026-08-14 07:52:34 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
function getColor(percent: number | string, darker: boolean): string {
|
||||
percent = Number(percent)
|
||||
if (percent >= 99.9) {
|
||||
return darker ? '#059669' : '#3bd671'
|
||||
} else if (percent >= 99) {
|
||||
return darker ? '#3bd671' : '#9deab8'
|
||||
} else if (percent >= 95) {
|
||||
return '#f29030'
|
||||
} else if (Number.isNaN(percent)) {
|
||||
return 'gray'
|
||||
} else {
|
||||
return '#df484a'
|
||||
}
|
||||
}
|
||||
|
||||
export { getColor }
|
||||
Reference in New Issue
Block a user