Make blue less blue more cyan

This commit is contained in:
2025-06-14 03:04:07 +02:00
parent 5b42b0b7fd
commit f62365d6a6

View File

@@ -1,11 +1,10 @@
export const getSecurityColor = (security: number): string => {
if (security > 0.5) {
// Green to blue for high security (0.5, 1]
// Cyan to light blue for high security (0.5, 1]
const ratio = (security - 0.5) / 0.5;
const green = Math.round(34 + (16 - 34) * ratio); // From #22c55e to #1065d4
const blue = Math.round(197 + (212 - 197) * ratio);
return `rgb(${Math.round(34 * (1 - ratio) + 16 * ratio)}, ${green}, ${blue})`;
const green = Math.round(200 + (180 - 200) * ratio); // From #00c8c8 to #00b4d8
const blue = Math.round(200 + (216 - 200) * ratio);
return `rgb(${Math.round(0 * (1 - ratio) + 0 * ratio)}, ${green}, ${blue})`;
} else if (security >= 0) {
// Red to yellow for low security [0.0, 0.5]
const ratio = security / 0.5;