Coverage for src / lexigram / ui / charts / config.py: 100%
10 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-10 04:11 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-10 04:11 +0800
1from __future__ import annotations
3CHART_COLORS: dict[str, str] = {
4 "blue": "#3B82F6",
5 "green": "#22C55E",
6 "red": "#EF4444",
7 "yellow": "#EAB308",
8 "purple": "#A855F7",
9 "primary": "var(--primary)",
10 "orange": "#F97316",
11 "pink": "#EC4899",
12 "teal": "#14B8A6",
13 "gray": "#6B7280",
14}
16CHART_BG: dict[str, str] = {
17 "blue": "bg-info",
18 "green": "bg-success",
19 "red": "bg-destructive",
20 "yellow": "bg-warning",
21 "purple": "bg-purple-500",
22 "primary": "bg-primary",
23 "orange": "bg-orange-500",
24 "pink": "bg-pink-500",
25 "teal": "bg-teal-500",
26 "gray": "bg-muted",
27}
29CHART_TEXT: dict[str, str] = {
30 "blue": "text-info",
31 "green": "text-success",
32 "red": "text-destructive",
33 "yellow": "text-warning",
34 "purple": "text-purple-600 dark:text-purple-400",
35 "primary": "text-primary",
36 "orange": "text-orange-600 dark:text-orange-400",
37 "pink": "text-pink-600 dark:text-pink-400",
38 "teal": "text-teal-600 dark:text-teal-400",
39 "gray": "text-muted-foreground",
40}
43def hex_color(color_name: str) -> str:
44 return CHART_COLORS.get(color_name, CHART_COLORS["blue"])
47def bg_class(color_name: str) -> str:
48 return CHART_BG.get(color_name, CHART_BG["blue"])
51def text_class(color_name: str) -> str:
52 return CHART_TEXT.get(color_name, CHART_TEXT["blue"])