1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| // Color tokens from Figma
| const colorTokens = {
| grape: {
| base: "var(--color-accent-grape-base)",
| },
| blueberry: {
| base: "var(--color-accent-blueberry-base)",
| },
| kale: {
| base: "var(--color-accent-kale-base)",
| },
| kiwi: {
| base: "var(--color-accent-kiwi-base)",
| },
| mango: {
| base: "var(--color-accent-mango-base)",
| },
| canteloupe: {
| base: "var(--color-accent-canteloupe-base)",
| },
| persimmon: {
| base: "var(--color-accent-persimmon-base)",
| },
| plum: {
| base: "var(--color-accent-plum-base)",
| },
| fig: {
| base: "var(--color-accent-fig-base)",
| },
| sand: {
| bold: "var(--color-accent-sand-bold)",
| },
| };
|
| // Order of colors for optimal contrast
| const colorOrder = ["grape", "mango", "kale", "persimmon", "sand", "kiwi", "canteloupe", "fig", "plum", "blueberry"];
|
| /**
| * Get a color for a channel based on its index
| * @param {number} index - Index of the channel
| * @returns {string} - CSS variable for the color
| */
| export const getChannelColor = (index) => {
| const colorName = colorOrder[index % colorOrder.length];
| return colorTokens[colorName][colorName === "sand" ? "bold" : "base"];
| };
|
|