Skip to content

Commit 8a440f8

Browse files
authored
fix#28-risk-color (#38)
2 parents 645684f + 73946b1 commit 8a440f8

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
--sidebar-ring: oklch(0.708 0 0);
132132
--risk-very-danger: #ff6f6f;
133133
--risk-danger: #ffba6f;
134-
--risk-good: #ffe93f;
135-
--risk-safe: #d9ff41;
134+
--risk-good: #f5e03c;
135+
--risk-safe: #d0f14f;
136136
--risk-very-safe: #2cdf44;
137137
}
138138

src/shared/constants/risk-chart-segments.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export type RiskSegment = {
1212
};
1313

1414
// 색상 상수
15-
const COLORS = {
15+
export const COLORS = {
1616
RED: '#ff6f6f',
1717
ORANGE: '#ffba6f',
18-
YELLOW: '#ffe93f',
19-
YELLOW_GREEN: '#d9ff41',
18+
YELLOW: '#f5e03c',
19+
YELLOW_GREEN: '#d0f14f',
2020
GREEN: '#2cdf44',
2121
} as const;
2222

src/shared/utils/chart/chart-colors.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* 차트 색상 관련 유틸리티
33
*/
4-
import { CHART_COLORS, CHART_COLOR_CLASSES, RISK_SCORE_COLORS } from '../../constants';
4+
import { CHART_COLORS, CHART_COLOR_CLASSES, COLORS, RISK_SCORE_COLORS } from '../../constants';
55

66
/**
77
* 인덱스에 따른 차트 색상 CSS 변수를 반환
@@ -41,23 +41,23 @@ export const getRiskScoreColorClass = (score: number): string => {
4141
*/
4242
export const getRiskColorClass = (hexColor: string): string => {
4343
const colorMap: Record<string, string> = {
44-
'#ff6f6f': 'bg-risk-very-danger', // 매우 위험
45-
'#ffba6f': 'bg-risk-danger', // 위험
46-
'#ffe93f': 'bg-risk-good', // 양호
47-
'#d9ff41': 'bg-risk-safe', // 안전
48-
'#2cdf44': 'bg-risk-very-safe', // 매우 안전
44+
[COLORS.RED]: 'bg-risk-very-danger', // 매우 위험
45+
[COLORS.ORANGE]: 'bg-risk-danger', // 위험
46+
[COLORS.YELLOW]: 'bg-risk-good', // 양호
47+
[COLORS.YELLOW_GREEN]: 'bg-risk-safe', // 안전
48+
[COLORS.GREEN]: 'bg-risk-very-safe', // 매우 안전
4949
};
5050

5151
return colorMap[hexColor] || 'bg-gray-400';
5252
};
5353

5454
export const getRiskBoxShadowClass = (hexColor: string): string => {
5555
const colorMap: Record<string, string> = {
56-
'#ff6f6f': 'shadow-[0_0_12px_var(--color-risk-very-danger)]', // 매우 위험
57-
'#ffba6f': 'shadow-[0_0_12px_var(--color-risk-danger)]', // 위험
58-
'#ffe93f': 'shadow-[0_0_12px_var(--color-risk-good)]', // 양호
59-
'#d9ff41': 'shadow-[0_0_12px_var(--color-risk-safe)]', // 안전
60-
'#2cdf44': 'shadow-[0_0_12px_var(--color-risk-very-safe)]', // 매우 안전
56+
[COLORS.RED]: 'shadow-[0_0_12px_var(--color-risk-very-danger)]', // 매우 위험
57+
[COLORS.ORANGE]: 'shadow-[0_0_12px_var(--color-risk-danger)]', // 위험
58+
[COLORS.YELLOW]: 'shadow-[0_0_12px_var(--color-risk-good)]', // 양호
59+
[COLORS.YELLOW_GREEN]: 'shadow-[0_0_12px_var(--color-risk-safe)]', // 안전
60+
[COLORS.GREEN]: 'shadow-[0_0_12px_var(--color-risk-very-safe)]', // 매우 안전
6161
};
6262
return colorMap[hexColor] || 'shadow-[0_0_12px_rgba(156,163,175,0.5)]';
6363
};

0 commit comments

Comments
 (0)