Skip to content

Commit 3aed4a6

Browse files
committed
feat: add anycode theme cloned from vesper with #242424 background and set as default
1 parent d839e62 commit 3aed4a6

4 files changed

Lines changed: 295 additions & 17 deletions

File tree

anycode-backend/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
theme = "themes/vesper.yml"
1+
theme = "themes/anycode.json"
22
left_panel_width = 25
33
autosave = true
44

anycode-base/src/theme.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,25 @@ export let edgo = {
9191
"accent_color": "#767676",
9292
"accent_color2": "#F9D992"
9393
}
94+
95+
export let anycode = {
96+
"string": "#b1fce5",
97+
"variable": "#fff",
98+
"variable.builtin": "#a0a0a0",
99+
"function": "#f6c99f",
100+
"type": "#f6c99f",
101+
"namespace": "#f6c99f",
102+
"method": "#f6c99f",
103+
"function.method": "#f6c99f",
104+
"function.macro": '#f6c99f',
105+
"function.builtin": '#f6c99f',
106+
"constructor": "#f6c99f",
107+
"identifier": "#A5FCB6",
108+
"keyword": "#a0a0a0",
109+
"number": "#b1fce5",
110+
"constant": '#f6c99f',
111+
"comment": "#727171",
112+
"accent_color": "#b1fce5",
113+
"accent_color2": "#a0a0a0"
114+
};
115+

anycode/hooks/useTheme.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type UseThemeParams = {
1010
export const useTheme = ({ wsRef, isConnected }: UseThemeParams) => {
1111
const [currentThemeId, setCurrentThemeId] = useState<string | null>(() => {
1212
if (typeof window === 'undefined') return null;
13-
return localStorage.getItem('themeId');
13+
return localStorage.getItem('themeId') || 'anycode.json:anycode';
1414
});
1515

1616
const applyBrowserChromeColor = useCallback((color: string) => {
@@ -118,21 +118,19 @@ export const useTheme = ({ wsRef, isConnected }: UseThemeParams) => {
118118
return;
119119
}
120120

121-
const storedThemeId = localStorage.getItem('themeId');
122-
const storedThemeFileName = localStorage.getItem('themeFileName');
123-
const storedThemeName = localStorage.getItem('themeName');
124-
125-
if (storedThemeId && storedThemeFileName && storedThemeName) {
126-
wsRef.current.emit('theme:get', {
127-
fileName: storedThemeFileName,
128-
themeName: storedThemeName,
129-
}, (res: any) => {
130-
if (res && res.success && res.theme) {
131-
applyTheme(res.theme);
132-
setCurrentThemeId(storedThemeId);
133-
}
134-
});
135-
}
121+
const storedThemeId = localStorage.getItem('themeId') || 'anycode.json:anycode';
122+
const storedThemeFileName = localStorage.getItem('themeFileName') || 'anycode.json';
123+
const storedThemeName = localStorage.getItem('themeName') || 'anycode';
124+
125+
wsRef.current.emit('theme:get', {
126+
fileName: storedThemeFileName,
127+
themeName: storedThemeName,
128+
}, (res: any) => {
129+
if (res && res.success && res.theme) {
130+
applyTheme(res.theme);
131+
setCurrentThemeId(storedThemeId);
132+
}
133+
});
136134
}, [isConnected, wsRef, applyTheme]);
137135

138136
return {

themes/anycode.json

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
{
2+
"$schema": "https://github.com/longbridge/gpui-component/raw/refs/heads/main/.theme-schema.json",
3+
"name": "anycode",
4+
"author": "anycode",
5+
"url": "https://github.com/anycode-ade/anycode",
6+
"themes": [
7+
{
8+
"is_default": true,
9+
"name": "anycode",
10+
"mode": "dark",
11+
"colors": {
12+
"accent.background": "#171717b3",
13+
"accent.foreground": "#fafafa",
14+
"accordion.background": "#242424",
15+
"background": "#242424",
16+
"border": "#4a4a4a",
17+
"group_box.background": "#171717",
18+
"group_box.foreground": "#fafafa",
19+
"caret": "#fafafa",
20+
"chart_1": "#93c5fd",
21+
"chart_2": "#3b82f6",
22+
"chart_3": "#2563eb",
23+
"chart_4": "#1d4ed8",
24+
"chart_5": "#1e40af",
25+
"danger.background": "#7f1d1d",
26+
"danger.active.background": "#661717",
27+
"danger.foreground": "#fef2f2",
28+
"danger.hover.background": "#8b2020",
29+
"description_list_label.background": "#171717",
30+
"description_list_label.foreground": "#f5f5f5",
31+
"drag_border": "#3b82f6",
32+
"drop_target.background": "#3b82f619",
33+
"foreground": "#fafafa",
34+
"info.background": "#0c4a6e",
35+
"info.active.background": "#0a3c5a",
36+
"info.foreground": "#f0f9ff",
37+
"info.hover.background": "#0d5077",
38+
"input.border": "#262626",
39+
"link.foreground": "#fafafa",
40+
"link.active.foreground": "#d4d4d4",
41+
"link.hover.foreground": "#ffffff",
42+
"list.background": "#242424",
43+
"list.active.background": "#1e40af33",
44+
"list.active.border": "#1d4ed8",
45+
"list.even.background": "#17171766",
46+
"list.head.background": "#17171766",
47+
"muted.background": "#26262699",
48+
"muted.foreground": "#737373",
49+
"popover.background": "#242424",
50+
"popover.foreground": "#fafafa",
51+
"primary.background": "#fafafa",
52+
"primary.active.background": "#d4d4d4",
53+
"primary.foreground": "#171717",
54+
"primary.hover.background": "#e5e5e5",
55+
"progress_bar.background": "#f5f5f5",
56+
"ring": "#d4d4d4",
57+
"scrollbar.background": "#17171700",
58+
"scrollbar.thumb.background": "#525252e6",
59+
"scrollbar.thumb.hover.background": "#525252",
60+
"secondary.background": "#171717",
61+
"secondary.active.background": "#262626",
62+
"secondary.foreground": "#fafafa",
63+
"secondary.hover.background": "#1a1a1a",
64+
"selection.background": "#1d4ed8",
65+
"sidebar.background": "#242424",
66+
"sidebar.accent.background": "#262626",
67+
"sidebar.accent.foreground": "#f5f5f5",
68+
"sidebar.border": "#262626",
69+
"sidebar.foreground": "#f5f5f5",
70+
"sidebar.primary.background": "#f5f5f5",
71+
"sidebar.primary.foreground": "#0a0a0a",
72+
"skeleton.background": "#171717",
73+
"slider.bar.background": "#fafafa",
74+
"slider.thumb.background": "#242424",
75+
"success.background": "#14532d",
76+
"success.active.background": "#104224",
77+
"success.foreground": "#f0fdf4",
78+
"success.hover.background": "#165b32",
79+
"bullish.background": "#22c55e",
80+
"bearish.background": "#ef4444",
81+
"switch.background": "#404040",
82+
"tab.background": "#00000000",
83+
"tab.active.background": "#242424",
84+
"tab.active.foreground": "#fafafa",
85+
"tab_bar.background": "#171717",
86+
"tab_bar.segmented.background": "#171717",
87+
"tab.foreground": "#d4d4d4",
88+
"table.background": "#242424",
89+
"table.head.foreground": "#525252",
90+
"table.row.border": "#262626b3",
91+
"tiles.background": "#171717",
92+
"title_bar.background": "#171717",
93+
"title_bar.border": "#262626",
94+
"warning.background": "#713f12",
95+
"warning.active.background": "#5b320f",
96+
"warning.foreground": "#fefce8",
97+
"warning.hover.background": "#7b4414",
98+
"overlay": "#ffffff08",
99+
"window.border": "#262626",
100+
"base.red": "#ef4444",
101+
"base.red.light": "#fecaca",
102+
"base.green": "#22c55e",
103+
"base.green.light": "#bbf7d0",
104+
"base.blue": "#3b82f6",
105+
"base.blue.light": "#bfdbfe",
106+
"base.yellow": "#eab308",
107+
"base.yellow.light": "#fef08a",
108+
"base.magenta": "#9333ea",
109+
"base.magenta.light": "#e9d5ff",
110+
"base.cyan": "#06b6d4",
111+
"base.cyan.light": "#cffafe"
112+
},
113+
"highlight": {
114+
"editor.foreground": "#CACCCA",
115+
"editor.background": "#242424",
116+
"editor.active_line.background": "#2c2c2c",
117+
"editor.line_number": "#8F8F8F",
118+
"editor.active_line_number": "#DDDDDD",
119+
"editor.invisible": "#73737366",
120+
"conflict": "#D2602D",
121+
"created": "#3f72e2",
122+
"created.background": "#0C4619",
123+
"deleted.background": "#46190C",
124+
"error": "#A5FCB6",
125+
"error.background": "#46190C",
126+
"error.border": "#802207",
127+
"hidden": "#9E9E9E",
128+
"hint": "#b283f8",
129+
"hint.background": "#250c4b",
130+
"hint.border": "#3f0891",
131+
"info.background": "#0059D1",
132+
"info.border": "#0059D1",
133+
"modified": "#B0A878",
134+
"modified.background": "#3A310E",
135+
"predictive": "#5D5945",
136+
"success.background": "#0C4619",
137+
"warning.background": "#3A310E",
138+
"warning.border": "#7B6508",
139+
"syntax": {
140+
"attribute": {
141+
"color": "#c6a5fc"
142+
},
143+
"boolean": {
144+
"color": "#f6c99f"
145+
},
146+
"comment": {
147+
"color": "#585858"
148+
},
149+
"comment.doc": {
150+
"color": "#585858"
151+
},
152+
"constant": {
153+
"color": "#f6c99f"
154+
},
155+
"constructor": {
156+
"color": "#f6c99f"
157+
},
158+
"embedded": {
159+
"color": "#ffffff"
160+
},
161+
"function": {
162+
"color": "#f6c99f"
163+
},
164+
"keyword": {
165+
"color": "#a0a0a0"
166+
},
167+
"link_text": {
168+
"color": "#307BF6",
169+
"font_style": "normal"
170+
},
171+
"link_uri": {
172+
"color": "#7faef9",
173+
"font_style": "italic"
174+
},
175+
"number": {
176+
"color": "#f6c99f"
177+
},
178+
"string": {
179+
"color": "#b1fce5"
180+
},
181+
"string.escape": {
182+
"color": "#b1fce5"
183+
},
184+
"string.regex": {
185+
"color": "#b1fce5"
186+
},
187+
"string.special": {
188+
"color": "#b1fce5"
189+
},
190+
"string.special.symbol": {
191+
"color": "#b1fce5"
192+
},
193+
"tag": {
194+
"color": "#c6a5fc"
195+
},
196+
"text.literal": {
197+
"color": "#E1D797"
198+
},
199+
"title": {
200+
"color": "#fdd888",
201+
"font_weight": 600
202+
},
203+
"type": {
204+
"color": "#f6c99f"
205+
},
206+
"type.builtin": {
207+
"color": "#f6c99f"
208+
},
209+
"property": {
210+
"color": "#A5FCB6"
211+
},
212+
"namespace": {
213+
"color": "#f6c99f"
214+
},
215+
"variable": {
216+
"color": "#ffffff"
217+
},
218+
"variable.builtin": {
219+
"color": "#ffffff"
220+
},
221+
"variable.special": {
222+
"color": "#ffffff"
223+
},
224+
"function.call": {
225+
"color": "#f6c99f"
226+
},
227+
"function.macro": {
228+
"color": "#f6c99f"
229+
},
230+
"keyword.control": {
231+
"color": "#a0a0a0"
232+
},
233+
"keyword.function": {
234+
"color": "#a0a0a0"
235+
},
236+
"keyword.operator": {
237+
"color": "#a0a0a0"
238+
},
239+
"label": {
240+
"color": "#f6c99f"
241+
},
242+
"operator": {
243+
"color": "#a0a0a0"
244+
},
245+
"punctuation": {
246+
"color": "#a0a0a0"
247+
},
248+
"punctuation.bracket": {
249+
"color": "#a0a0a0"
250+
},
251+
"punctuation.delimiter": {
252+
"color": "#a0a0a0"
253+
}
254+
}
255+
}
256+
}
257+
]
258+
}

0 commit comments

Comments
 (0)