| 1 | export type ProjectColorKey = "" | "red" | "orange" | "amber" | "green" | "teal" | "blue" | "purple" | "pink"; |
| 2 | |
| 3 | export interface ProjectColorOption { |
| 4 | key: ProjectColorKey; |
| 5 | value?: string; |
| 6 | } |
| 7 | |
| 8 | export const PROJECT_COLOR_OPTIONS: ProjectColorOption[] = [ |
| 9 | { key: "" }, |
| 10 | { key: "red", value: "#e5534b" }, |
| 11 | { key: "orange", value: "#d66e4b" }, |
| 12 | { key: "amber", value: "#d59a2f" }, |
| 13 | { key: "green", value: "#4f9f64" }, |
| 14 | { key: "teal", value: "#1f9d93" }, |
| 15 | { key: "blue", value: "#3d7be0" }, |
| 16 | { key: "purple", value: "#8b6de8" }, |
| 17 | { key: "pink", value: "#cf6ca5" }, |
| 18 | ]; |
| 19 | |
| 20 | const colorValues = new Map(PROJECT_COLOR_OPTIONS.map((option) => [option.key, option.value])); |
| 21 | |
| 22 | export function projectColorValue(key?: string): string | undefined { |
| 23 | return colorValues.get((key || "") as ProjectColorKey); |
| 24 | } |
| 25 |