xonecas.io
64875
Mc

mini-coder / commit c1b6a41

feat: atom inspired themes

xonecas2026-07-13 c1b6a417058d738c67028ffe3bc53d78e413d92b parent fcb9ca9

1 file changed

src/themes.ts+119−1
@@ -5,6 +5,8 @@ export const TUI_THEME_IDS = [
55 "ansi16",
66 "molokai-dark",
77 "molokai-light",
8+ "atom-dark",
9+ "atom-light",
810 ] as const;
911
1012 export type TUIThemeId = (typeof TUI_THEME_IDS)[number];
@@ -57,6 +59,44 @@ const ansi16Palette: Theme = {
5759 color15: 15,
5860 };
5961
62+const atomDarkPalette: Theme = {
63+ color00: "#282c34",
64+ color01: "#e06c75",
65+ color02: "#98c379",
66+ color03: "#d19a66",
67+ color04: "#61afef",
68+ color05: "#c678dd",
69+ color06: "#56b6c2",
70+ color07: "#abb2bf",
71+ color08: "#5c6370",
72+ color09: "#ff7b86",
73+ color10: "#b5e890",
74+ color11: "#efb77e",
75+ color12: "#78c5ff",
76+ color13: "#dc8bea",
77+ color14: "#70d1dc",
78+ color15: "#ffffff",
79+};
80+
81+const atomLightPalette: Theme = {
82+ color00: "#383a42",
83+ color01: "#e45649",
84+ color02: "#50a14f",
85+ color03: "#986801",
86+ color04: "#4078f2",
87+ color05: "#a626a4",
88+ color06: "#0184bc",
89+ color07: "#eaeaeb",
90+ color08: "#696c77",
91+ color09: "#b8322a",
92+ color10: "#2f7d32",
93+ color11: "#745000",
94+ color12: "#245fc5",
95+ color13: "#852083",
96+ color14: "#006b98",
97+ color15: "#fafafa",
98+};
99+
60100 const molokaiDarkPalette: Theme = {
61101 color00: "#272822",
62102 color01: "#f92672",
@@ -95,6 +135,66 @@ const molokaiLightPalette: Theme = {
95135 color15: "#fffdf5",
96136 };
97137
138+const atomDarkSyntax = {
139+ baseStyle: { fgColor: theme.bwhite },
140+ scopeStyles: {
141+ comment: { fgColor: theme.white, italic: true },
142+ "markup.quote": { fgColor: theme.white, italic: true },
143+ keyword: { fgColor: theme.bmagenta },
144+ operator: { fgColor: theme.bcyan },
145+ string: { fgColor: theme.bgreen },
146+ escape: { fgColor: theme.bcyan },
147+ "markup.list": { fgColor: theme.byellow },
148+ number: { fgColor: theme.byellow },
149+ regexp: { fgColor: theme.bcyan },
150+ function: { fgColor: theme.bblue },
151+ command: { fgColor: theme.bblue },
152+ "markup.code": { fgColor: theme.bgreen },
153+ builtin: { fgColor: theme.bcyan },
154+ property: { fgColor: theme.bred },
155+ type: { fgColor: theme.byellow },
156+ meta: { fgColor: theme.bmagenta },
157+ "markup.heading": { fgColor: theme.bblue, bold: true },
158+ "diff.deleted": { fgColor: theme.bred },
159+ "diff.file.old": { fgColor: theme.bred },
160+ "diff.inserted": { fgColor: theme.bgreen },
161+ "diff.file.new": { fgColor: theme.bgreen },
162+ "diff.hunk": { fgColor: theme.bmagenta },
163+ "diff.header": { fgColor: theme.white },
164+ "diff.no-newline": { fgColor: theme.white },
165+ },
166+} as const satisfies SyntaxHighlightTheme;
167+
168+const atomLightSyntax = {
169+ baseStyle: { fgColor: theme.black },
170+ scopeStyles: {
171+ comment: { fgColor: theme.bblack, italic: true },
172+ "markup.quote": { fgColor: theme.bblack, italic: true },
173+ keyword: { fgColor: theme.bmagenta },
174+ operator: { fgColor: theme.bcyan },
175+ string: { fgColor: theme.bgreen },
176+ escape: { fgColor: theme.bcyan },
177+ "markup.list": { fgColor: theme.byellow },
178+ number: { fgColor: theme.byellow },
179+ regexp: { fgColor: theme.bcyan },
180+ function: { fgColor: theme.bblue },
181+ command: { fgColor: theme.bblue },
182+ "markup.code": { fgColor: theme.bgreen },
183+ builtin: { fgColor: theme.bcyan },
184+ property: { fgColor: theme.bred },
185+ type: { fgColor: theme.byellow },
186+ meta: { fgColor: theme.bmagenta },
187+ "markup.heading": { fgColor: theme.bblue, bold: true },
188+ "diff.deleted": { fgColor: theme.bred },
189+ "diff.file.old": { fgColor: theme.bred },
190+ "diff.inserted": { fgColor: theme.bgreen },
191+ "diff.file.new": { fgColor: theme.bgreen },
192+ "diff.hunk": { fgColor: theme.bmagenta },
193+ "diff.header": { fgColor: theme.bblack },
194+ "diff.no-newline": { fgColor: theme.bblack },
195+ },
196+} as const satisfies SyntaxHighlightTheme;
197+
98198 const molokaiDarkSyntax = {
99199 baseStyle: { fgColor: theme.white },
100200 scopeStyles: {
@@ -183,6 +283,24 @@ export const TUI_THEMES = {
183283 rootBgColor: theme.bwhite,
184284 userMessageBgColor: theme.white,
185285 },
286+ "atom-dark": {
287+ id: "atom-dark",
288+ label: "atom dark",
289+ palette: atomDarkPalette,
290+ syntax: atomDarkSyntax,
291+ rootFgColor: theme.bwhite,
292+ rootBgColor: theme.black,
293+ userMessageBgColor: theme.bblack,
294+ },
295+ "atom-light": {
296+ id: "atom-light",
297+ label: "atom light",
298+ palette: atomLightPalette,
299+ syntax: atomLightSyntax,
300+ rootFgColor: theme.black,
301+ rootBgColor: theme.bwhite,
302+ userMessageBgColor: theme.white,
303+ },
186304 } as const satisfies Record<TUIThemeId, TUIThemeDefinition>;
187305
188306 export function getTUITheme(id: TUIThemeId): TUIThemeDefinition {
@@ -196,7 +314,7 @@ export function textColorForBackground(
196314 if (bgColor === theme.bblack) return theme.bwhite;
197315
198316 if (
199- themeId === "molokai-light" &&
317+ (themeId === "molokai-light" || themeId === "atom-light") &&
200318 (
201319 [
202320 theme.bred,