Code format

This commit is contained in:
2025-08-09 21:34:02 +02:00
parent c10f4b43cb
commit 90b190b8d5
24 changed files with 108 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
export const getSecurityColor = (security: number): string => {
// Clamp security between -1 and 1
const clampedSecurity = Math.max(-1, Math.min(1, security));
// Define color points for specific security values
const colorPoints = [
{ sec: -1.0, color: [75, 0, 130] }, // Dark purple (same as 0.1)
@@ -31,7 +31,7 @@ export const getSecurityColor = (security: number): string => {
// Calculate the ratio between the two points
const ratio = (clampedSecurity - lowerPoint.sec) / (upperPoint.sec - lowerPoint.sec);
// Interpolate between the colors
const red = Math.round(lowerPoint.color[0] + (upperPoint.color[0] - lowerPoint.color[0]) * ratio);
const green = Math.round(lowerPoint.color[1] + (upperPoint.color[1] - lowerPoint.color[1]) * ratio);