Files
orion-visor/orion-visor-ui/src/utils/charts.ts
lijiahangmax 8aa8cda677 🔨 前端升级.
2025-09-24 15:54:01 +08:00

15 lines
361 B
TypeScript

// 获取百分比进度颜色
export const getPercentProgressColor = (percent: number, defaultColor = 'rgb(var(--green-6))') => {
try {
if (percent < 0.6) {
return defaultColor;
} else if (percent < 0.8) {
return 'rgb(var(--orange-6))';
} else {
return 'rgb(var(--red-6))';
}
} catch (e) {
return defaultColor;
}
};