|
| 1 | +export const colors = { |
| 2 | + boltz: { |
| 3 | + primary: "#e8cb2b", |
| 4 | + "primary-light": "#fee86b", |
| 5 | + link: "#4fadc2", |
| 6 | + "link-hover": "#70cde2", |
| 7 | + }, |
| 8 | + navy: { |
| 9 | + 50: "#d0d4d9", |
| 10 | + 100: "#a1a9b2", |
| 11 | + 200: "#727e8c", |
| 12 | + 300: "#1e2d3c", |
| 13 | + 400: "#17222e", |
| 14 | + 500: "#12253a", |
| 15 | + 600: "#0f1f30", |
| 16 | + 700: "#091625", |
| 17 | + 800: "#09141f", |
| 18 | + 900: "#081E36", |
| 19 | + }, |
| 20 | + text: { |
| 21 | + primary: "#d7dee4", |
| 22 | + secondary: "#a1a9b2", |
| 23 | + muted: "#727e8c", |
| 24 | + }, |
| 25 | + chart: { |
| 26 | + bitcoin: "#f7931a", |
| 27 | + chain: "#e74c3c", |
| 28 | + olive: "#6b8e23", |
| 29 | + purple: "#9370db", |
| 30 | + coral: "#ff6b6b", |
| 31 | + teal: "#56a8a1", |
| 32 | + gold: "#d4a04a", |
| 33 | + steel: "#5e81ac", |
| 34 | + }, |
| 35 | +} as const; |
| 36 | + |
| 37 | +export const CHART_COLORS = { |
| 38 | + primary: colors.boltz.primary, |
| 39 | + grid: colors.navy[300], |
| 40 | + axisTick: colors.navy[200], |
| 41 | + activeDotStroke: colors.navy[700], |
| 42 | + tooltipCursor: "rgba(30, 45, 60, 0.35)", |
| 43 | +} as const; |
| 44 | + |
| 45 | +export const SWAP_TYPE_COLORS = { |
| 46 | + submarine: colors.boltz.link, |
| 47 | + reverse: colors.chart.bitcoin, |
| 48 | + chain: colors.chart.chain, |
| 49 | +} as const; |
| 50 | + |
| 51 | +export const FAILURE_RATE_COLORS = { |
| 52 | + submarine: colors.chart.teal, |
| 53 | + reverse: colors.chart.gold, |
| 54 | + chain: colors.chart.steel, |
| 55 | +} as const; |
| 56 | + |
| 57 | +export const PAIR_COLORS: Record<string, string> = { |
| 58 | + "BTC/BTC": colors.chart.bitcoin, |
| 59 | + "L-BTC/BTC": colors.boltz.link, |
| 60 | + "RBTC/BTC": colors.chart.olive, |
| 61 | + "BTC/RBTC": colors.chart.purple, |
| 62 | + "L-BTC/RBTC": colors.chart.coral, |
| 63 | +}; |
| 64 | + |
| 65 | +export function getPairColor(pair: string): string { |
| 66 | + const key = pair.trim().toUpperCase(); |
| 67 | + |
| 68 | + if (PAIR_COLORS[key]) return PAIR_COLORS[key]; |
| 69 | + |
| 70 | + const [from, to] = key.split("/"); |
| 71 | + if (from && to) { |
| 72 | + const reversed = `${to}/${from}`; |
| 73 | + if (PAIR_COLORS[reversed]) return PAIR_COLORS[reversed]; |
| 74 | + } |
| 75 | + |
| 76 | + return colors.boltz.primary; |
| 77 | +} |
0 commit comments