obv 선 표시

This commit is contained in:
Macbook
2026-06-09 01:13:54 +09:00
parent 1f0671aa7a
commit 969b2fa6ad
7 changed files with 68 additions and 21 deletions
+9
View File
@@ -45,6 +45,15 @@ export function plotColorCss(value: string): string {
return `rgba(${r},${g},${b},${(alpha / 100).toFixed(2)})`;
}
/** line 시리즈 색 — DB에 alpha 0·8자리 hex 저장 시 registry 기본색으로 복원 */
export function resolvePlotLineColor(color: string | undefined, fallback: string): string {
const raw = (color ?? fallback).trim();
const fb = fallback.length >= 7 && fallback.startsWith('#') ? fallback.slice(0, 7) : '#2962FF';
const { alpha } = parsePlotColor(raw);
if (alpha < 10) return fb;
return plotColorCss(raw);
}
export const LINE_WIDTH_OPTIONS = [1, 2, 3, 4] as const;
export const LINE_STYLE_OPTIONS: HLineStyle[] = ['solid', 'dashed', 'dotted'];