forked from JhaSourav07/commitpulse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththemes.ts
More file actions
45 lines (42 loc) · 2.16 KB
/
Copy paththemes.ts
File metadata and controls
45 lines (42 loc) · 2.16 KB
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
// lib/svg/themes.ts
import { BadgeTheme } from '../../types';
import { hexColor } from './sanitizer';
function makeTheme(bg: string, text: string, accent: string, negative?: string): BadgeTheme {
return {
bg: hexColor(bg),
text: hexColor(text),
accent: hexColor(accent),
negative: negative ? hexColor(negative) : undefined,
};
}
export const themes: Record<string, BadgeTheme> = {
dark: makeTheme('0d1117', 'c9d1d9', '58a6ff', 'f85149'),
light: makeTheme('ffffff', '24292f', '0969da', 'cf222e'),
neon: makeTheme('000000', '00ffcc', 'ff00ff', 'ff0055'),
github: makeTheme('0d1117', 'ffffff', '238636', 'f85149'),
dracula: makeTheme('282a36', 'f8f8f2', 'bd93f9', 'ff5555'),
ocean: makeTheme('0a192f', 'ccd6f6', '64ffda', 'ff6b6b'),
sunset: makeTheme('1a0a0a', 'ffd6c0', 'ff6b35', 'ff4d4d'),
forest: makeTheme('0d1f0d', 'c8f0c8', '39d353', 'ff6b6b'),
rose: makeTheme('1f0d14', 'f0c8d4', 'ff6b9d', 'ff4b72'),
nord: makeTheme('2e3440', 'd8dee9', '88c0d0', 'bf616a'),
synthwave: makeTheme('0d0221', 'f8f8f2', 'ff2d78', 'ff3864'),
gruvbox: makeTheme('282828', 'ebdbb2', 'fe8019', 'fb4934'),
aurora_cyberpunk: makeTheme('090B13', 'EAF2FF', '9D5CFF', 'FF3366'),
highcontrast: makeTheme('0a0a0a', 'ffffff', 'ff4500', 'ff3333'),
catppuccin_latte: makeTheme('eff1f5', '4c4f69', '1e66f5', 'd20f39'),
solarized_light: makeTheme('fdf6e3', '586e75', '268bd2', 'dc322f'),
gruvbox_light: makeTheme('fbf1c7', '3c3836', 'd65d0e', '9d0006'),
nord_light: makeTheme('eceff4', '2e3440', '5e81ac', 'bf616a'),
obsidian: makeTheme('1a1a2e', 'e2e8f0', 'f59e0b'),
'cyber-pulse': makeTheme('000000', 'ffffff', '00ffee', 'ff0055'),
glacier: makeTheme('e0f2fe', '0369a1', '06b6d4', 'ef4444'),
lumos: makeTheme('0a0a0a', 'a7f3d0', 'fbbf24', 'ef4444'),
tokyonight: makeTheme('1a1b26', 'c0caf5', 'f7768e'),
cyberpunk: makeTheme('fce22a', '111111', 'ff003c'),
};
// Auto-theme pairs: the SVG switches between these two palettes
// using @media (prefers-color-scheme) so the badge adapts to the
// viewer's OS-level light/dark setting without any JavaScript.
export const AUTO_THEME_LIGHT: BadgeTheme = themes.light;
export const AUTO_THEME_DARK: BadgeTheme = themes.dark;