|
16 | 16 |
|
17 | 17 | import type { TextProps } from "ink" |
18 | 18 |
|
19 | | -type StatusThemeColor = |
20 | | - | "gray" |
21 | | - | "white" |
22 | | - | "lightYellow" |
23 | | - | "yellow" |
24 | | - | "lightBlue" |
25 | | - | "red" |
26 | | - | "blue" |
27 | | - | "magenta" |
28 | | - | "lightGreen" |
29 | | - | "green" |
| 19 | +export type StatusTheme = [TextProps, TextProps, TextProps, TextProps, TextProps, TextProps] |
30 | 20 |
|
31 | | -export type StatusTheme = Record<StatusThemeColor, TextProps> |
| 21 | +/** This uses the user's terminal colors */ |
| 22 | +export const user: StatusTheme = [ |
| 23 | + { color: "gray" }, |
| 24 | + { color: "magenta" }, |
| 25 | + { color: "blue" }, |
| 26 | + { color: "green", dimColor: true }, |
| 27 | + { color: "green" }, |
| 28 | + { color: "red" }, |
| 29 | +] |
32 | 30 |
|
33 | | -export const defaultStatusTheme: StatusTheme = { |
34 | | - gray: { color: "gray" }, |
35 | | - white: { color: "white", dimColor: true }, |
36 | | - lightYellow: { color: "yellow", dimColor: true }, |
37 | | - yellow: { color: "yellow" }, |
38 | | - lightBlue: { color: "blue" }, |
39 | | - red: { color: "red" }, |
40 | | - blue: { color: "cyan" }, |
41 | | - magenta: { color: "magenta" }, |
42 | | - lightGreen: { color: "green", dimColor: true }, |
43 | | - green: { color: "green" }, |
44 | | -} |
| 31 | +export const carbon: StatusTheme = [ |
| 32 | + { color: "#8d8d8d" }, // gray50 |
| 33 | + { color: "#d4bbff" }, // purple30 |
| 34 | + { color: "#0072c3" }, // cyan50 |
| 35 | + { color: "#6fdc8c" }, // green30 |
| 36 | + { color: "#198038" }, // green60 |
| 37 | + { color: "#fa4d56" }, // red50 |
| 38 | +] |
45 | 39 |
|
46 | | -export const carbonStatusTheme: StatusTheme = { |
47 | | - gray: { color: "#8d8d8d" }, // gray50 |
48 | | - white: { color: "#ff832b" }, // orange40 |
49 | | - lightYellow: { color: "#fddc69" }, // yellow20 |
50 | | - yellow: { color: "#8e6a00" }, // yellow60 |
51 | | - lightBlue: { color: "#82cfff" }, // cyan30 |
52 | | - red: { color: "#fa4d56" }, // red50 |
53 | | - blue: { color: "#0072c3" }, // cyan50 |
54 | | - magenta: { color: "#d4bbff" }, // purple30 |
55 | | - lightGreen: { color: "#6fdc8c" }, // green30 |
56 | | - green: { color: "#198038" }, // green60 |
57 | | -} |
| 40 | +export const patternfly: StatusTheme = [ |
| 41 | + { color: "#B8BBBE" }, // black-400 |
| 42 | + { color: "#A18FFF" }, // purple-300 |
| 43 | + { color: "#2B9AF3" }, // blue-300 |
| 44 | + { color: "#C8EB79" }, // light-green-200 |
| 45 | + { color: "#5BA352" }, // green-400 |
| 46 | + { color: "#C9190B" }, // red-100 |
| 47 | +] |
58 | 48 |
|
59 | | -export const patternflyStatusTheme: StatusTheme = { |
60 | | - gray: { color: "#B8BBBE" }, // black-400 |
61 | | - white: { color: "#EC7A08" }, // orange-400 |
62 | | - lightYellow: { color: "#F9E0A2" }, // gold-100 |
63 | | - yellow: { color: "#C58C00" }, // gold-500 |
64 | | - lightBlue: { color: "#35CAED" }, // light-blue-300 |
65 | | - red: { color: "#C9190B" }, // red-100 |
66 | | - blue: { color: "#2B9AF3" }, // blue-300 |
67 | | - magenta: { color: "#A18FFF" }, // purple-300 |
68 | | - lightGreen: { color: "#C8EB79" }, // light-green-200 |
69 | | - green: { color: "#5BA352" }, // green-400 |
70 | | -} |
| 49 | +/** https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=8 */ |
| 50 | +export const colorbrewer: StatusTheme = [ |
| 51 | + { color: "#fddbc7" }, |
| 52 | + { color: "#ef8a62" }, |
| 53 | + { color: "#d1e5f0" }, |
| 54 | + { color: "#67a9cf" }, |
| 55 | + { color: "#2166ac" }, |
| 56 | + { color: "#b2182b" }, |
| 57 | + /* { color: "#5e4fa2" }, |
| 58 | + { color: "#3288bd" }, |
| 59 | + { color: "#e6f598" }, |
| 60 | + { color: "#66c2a5" }, |
| 61 | + { color: "#d53e4f" },*/ |
| 62 | +] |
71 | 63 |
|
72 | 64 | export const statusThemes = { |
73 | | - user: defaultStatusTheme, |
74 | | - carbon: carbonStatusTheme, |
75 | | - patternfly: patternflyStatusTheme, |
| 65 | + user, |
| 66 | + carbon, |
| 67 | + patternfly, |
| 68 | + colorbrewer, |
76 | 69 | } |
77 | 70 |
|
78 | 71 | export type ValidTheme = keyof typeof statusThemes |
|
0 commit comments