silvery 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{animation-DhINOJk8.mjs → animation-Cn64yepo.mjs} +1 -1
- package/dist/{animation-DhINOJk8.mjs.map → animation-Cn64yepo.mjs.map} +1 -1
- package/dist/{ansi-C6Qs1Wn2.mjs → ansi-CLOitHKx.mjs} +1 -1
- package/dist/ansi-CLOitHKx.mjs.map +1 -0
- package/dist/{ansi-CsjnZtAw.d.mts → ansi-Cc33mW54.d.mts} +1 -1
- package/dist/{ansi-CsjnZtAw.d.mts.map → ansi-Cc33mW54.d.mts.map} +1 -1
- package/dist/{chunk-BSw8zbkd.mjs → chunk-Vs_PY4HZ.mjs} +1 -1
- package/dist/cli-BKp0YtBD.mjs +4 -0
- package/dist/{context-BjWgrikx.mjs → context-BU5LkkIy.mjs} +8 -7
- package/dist/context-BU5LkkIy.mjs.map +1 -0
- package/dist/devtools-9QY4teqI.mjs +2 -0
- package/dist/{devtools-CeO9X_uv.mjs → devtools-DxkSLXDA.mjs} +4 -5
- package/dist/devtools-DxkSLXDA.mjs.map +1 -0
- package/dist/{eta-BnQSZcWf.mjs → eta-Bb3RH3wh.mjs} +1 -1
- package/dist/{eta-BnQSZcWf.mjs.map → eta-Bb3RH3wh.mjs.map} +1 -1
- package/dist/{flexily-zero-adapter-BOM0cl8R.mjs → flexily-zero-adapter-BlQa46nr.mjs} +21 -64
- package/dist/flexily-zero-adapter-BlQa46nr.mjs.map +1 -0
- package/dist/{flexily-zero-adapter-V8R3HQtK.mjs → flexily-zero-adapter-CMxXhdOL.mjs} +1 -1
- package/dist/{image-B0zMbVUr.mjs → image-CTII5QWI.mjs} +3 -3
- package/dist/image-CTII5QWI.mjs.map +1 -0
- package/dist/{index-Bh3U1K09.d.mts → index-BXslOebb.d.mts} +547 -137
- package/dist/index-BXslOebb.d.mts.map +1 -0
- package/dist/{index-C4vrhbud.d.mts → index-BnA7mNpo.d.mts} +1 -1
- package/dist/{index-C4vrhbud.d.mts.map → index-BnA7mNpo.d.mts.map} +1 -1
- package/dist/index-D3saHouR.d.mts +1392 -0
- package/dist/index-D3saHouR.d.mts.map +1 -0
- package/dist/index.d.mts +5 -33
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/{layout-engine--drvrWjD.mjs → layout-engine-B6Cdz1yZ.mjs} +1 -1
- package/dist/{layout-engine-Dr3cY5U4.mjs → layout-engine-ClUgv6jB.mjs} +3 -3
- package/dist/{layout-engine-Dr3cY5U4.mjs.map → layout-engine-ClUgv6jB.mjs.map} +1 -1
- package/dist/{multi-progress-CcdqJFlf.mjs → multi-progress-Bq9Oi_WI.mjs} +3 -3
- package/dist/{multi-progress-CcdqJFlf.mjs.map → multi-progress-Bq9Oi_WI.mjs.map} +1 -1
- package/dist/{multi-progress-DQ-uUzLf.d.mts → multi-progress-DAQC7eap.d.mts} +2 -2
- package/dist/{multi-progress-DQ-uUzLf.d.mts.map → multi-progress-DAQC7eap.d.mts.map} +1 -1
- package/dist/{node-CP5WChgr.mjs → node-BeWlnCPY.mjs} +4 -4
- package/dist/node-BeWlnCPY.mjs.map +1 -0
- package/dist/{progress-bar-IrUjkLfU.mjs → progress-bar-CXE5Qfkd.mjs} +4 -4
- package/dist/progress-bar-CXE5Qfkd.mjs.map +1 -0
- package/dist/reconciler-Cwgm8hRR.mjs +8459 -0
- package/dist/reconciler-Cwgm8hRR.mjs.map +1 -0
- package/dist/{render-string-DVfgc8xr.mjs → render-string-Cbuf63Ya.mjs} +936 -136
- package/dist/render-string-Cbuf63Ya.mjs.map +1 -0
- package/dist/{render-string-BwLG7rIX.mjs → render-string-Tv-jqM16.mjs} +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +3 -3
- package/dist/{spinner-BRkaJI0N.d.mts → spinner-CGo34vyR.d.mts} +2 -2
- package/dist/{spinner-BRkaJI0N.d.mts.map → spinner-CGo34vyR.d.mts.map} +1 -1
- package/dist/{spinner-BmldKx0M.mjs → spinner-CeOmcuw_.mjs} +3 -3
- package/dist/spinner-CeOmcuw_.mjs.map +1 -0
- package/dist/src-B5GjfG7g.mjs +4305 -0
- package/dist/src-B5GjfG7g.mjs.map +1 -0
- package/dist/{src-CJPXf3fC.mjs → src-C2uvC-r0.mjs} +7535 -6467
- package/dist/src-C2uvC-r0.mjs.map +1 -0
- package/dist/{src-D8kLrQBT.mjs → src-CChwjk0Z.mjs} +8 -86
- package/dist/src-CChwjk0Z.mjs.map +1 -0
- package/dist/{src-D_BS-as7.mjs → src-NCKb8kE5.mjs} +777 -776
- package/dist/src-NCKb8kE5.mjs.map +1 -0
- package/dist/theme.d.mts +2 -130
- package/dist/theme.mjs +3 -8
- package/dist/{types-B4A8Ebba.d.mts → types-BH_v3iMT.d.mts} +1 -1
- package/dist/{types-B4A8Ebba.d.mts.map → types-BH_v3iMT.d.mts.map} +1 -1
- package/dist/{types-e4dpfbSa.mjs → types-Bk2yw9Qj.mjs} +3 -3
- package/dist/types-Bk2yw9Qj.mjs.map +1 -0
- package/dist/ui/animation.d.mts +1 -1
- package/dist/ui/animation.mjs +1 -1
- package/dist/ui/ansi.d.mts +1 -1
- package/dist/ui/ansi.mjs +1 -1
- package/dist/ui/cli.d.mts +3 -3
- package/dist/ui/cli.mjs +5 -5
- package/dist/ui/display.d.mts +1 -1
- package/dist/ui/display.mjs.map +1 -1
- package/dist/ui/image.d.mts +1 -1
- package/dist/ui/image.mjs +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.d.mts.map +1 -1
- package/dist/ui/input.mjs +2 -4
- package/dist/ui/input.mjs.map +1 -1
- package/dist/ui/progress.d.mts +3 -3
- package/dist/ui/progress.d.mts.map +1 -1
- package/dist/ui/progress.mjs +3 -3
- package/dist/ui/progress.mjs.map +1 -1
- package/dist/ui/react.d.mts +1 -1
- package/dist/ui/react.d.mts.map +1 -1
- package/dist/ui/react.mjs +2 -2
- package/dist/ui/react.mjs.map +1 -1
- package/dist/ui/utils.mjs +1 -1
- package/dist/ui/wrappers.d.mts +2 -2
- package/dist/ui/wrappers.mjs +1 -1
- package/dist/ui.d.mts +5 -5
- package/dist/ui.mjs +6 -6
- package/dist/{useLatest-6xqnGIU6.d.mts → useLatest-Bg2x4bfP.d.mts} +1 -1
- package/dist/{useLatest-6xqnGIU6.d.mts.map → useLatest-Bg2x4bfP.d.mts.map} +1 -1
- package/dist/{with-text-input-lUh9gYAG.d.mts → with-text-input-CRfoiFFG.d.mts} +3 -3
- package/dist/with-text-input-CRfoiFFG.d.mts.map +1 -0
- package/dist/{wrappers-JrEYTuKA.mjs → wrappers-UTADQkSY.mjs} +4 -4
- package/dist/wrappers-UTADQkSY.mjs.map +1 -0
- package/dist/{yoga-adapter-Bc8XT9cN.mjs → yoga-adapter-8oRGRw8V.mjs} +2 -2
- package/dist/{yoga-adapter-Bc8XT9cN.mjs.map → yoga-adapter-8oRGRw8V.mjs.map} +1 -1
- package/dist/yoga-adapter-D_CcxSt5.mjs +2 -0
- package/package.json +54 -45
- package/dist/UPNG-DvKjM6wE.mjs +0 -5076
- package/dist/UPNG-DvKjM6wE.mjs.map +0 -1
- package/dist/__vite-browser-external-2447137e-DPKHHqQK.mjs +0 -6
- package/dist/__vite-browser-external-2447137e-DPKHHqQK.mjs.map +0 -1
- package/dist/ansi-C6Qs1Wn2.mjs.map +0 -1
- package/dist/apng-CvSlLBtc.mjs +0 -3
- package/dist/apng-DFFVOItr.mjs +0 -70
- package/dist/apng-DFFVOItr.mjs.map +0 -1
- package/dist/assets/resvgjs.darwin-arm64-BtufyGW1.node +0 -0
- package/dist/backend-DU0Y938U.mjs +0 -13396
- package/dist/backend-DU0Y938U.mjs.map +0 -1
- package/dist/backends-BihMKFY_.mjs +0 -1181
- package/dist/backends-BihMKFY_.mjs.map +0 -1
- package/dist/backends-Dk_5G_gC.mjs +0 -3
- package/dist/cli-GwJ0S2In.mjs +0 -4
- package/dist/context-BjWgrikx.mjs.map +0 -1
- package/dist/derive-O_Kb1Bk_.d.mts +0 -28
- package/dist/derive-O_Kb1Bk_.d.mts.map +0 -1
- package/dist/devtools-CeO9X_uv.mjs.map +0 -1
- package/dist/devtools-nX4tj6OH.mjs +0 -2
- package/dist/flexily-zero-adapter-BOM0cl8R.mjs.map +0 -1
- package/dist/gif-B9Uq4qZA.mjs +0 -73
- package/dist/gif-B9Uq4qZA.mjs.map +0 -1
- package/dist/gif-BdrLRBmM.mjs +0 -3
- package/dist/gifenc-DfhOb4xr.mjs +0 -730
- package/dist/gifenc-DfhOb4xr.mjs.map +0 -1
- package/dist/image-B0zMbVUr.mjs.map +0 -1
- package/dist/index-Bh3U1K09.d.mts.map +0 -1
- package/dist/index-dehZ18K-.d.mts +0 -679
- package/dist/index-dehZ18K-.d.mts.map +0 -1
- package/dist/key-mapping-7k2ufK2b.mjs +0 -3
- package/dist/key-mapping-WLUmxjx1.mjs +0 -132
- package/dist/key-mapping-WLUmxjx1.mjs.map +0 -1
- package/dist/node-CP5WChgr.mjs.map +0 -1
- package/dist/progress-bar-IrUjkLfU.mjs.map +0 -1
- package/dist/reconciler-B8uxQxaU.mjs +0 -16482
- package/dist/reconciler-B8uxQxaU.mjs.map +0 -1
- package/dist/render-string-DVfgc8xr.mjs.map +0 -1
- package/dist/resvg-js-Cwipz-_J.mjs +0 -203
- package/dist/resvg-js-Cwipz-_J.mjs.map +0 -1
- package/dist/spinner-BmldKx0M.mjs.map +0 -1
- package/dist/src-C0sOQW-t.mjs +0 -3866
- package/dist/src-C0sOQW-t.mjs.map +0 -1
- package/dist/src-CJPXf3fC.mjs.map +0 -1
- package/dist/src-D8kLrQBT.mjs.map +0 -1
- package/dist/src-D_BS-as7.mjs.map +0 -1
- package/dist/theme.d.mts.map +0 -1
- package/dist/theme.mjs.map +0 -1
- package/dist/types-e4dpfbSa.mjs.map +0 -1
- package/dist/with-text-input-lUh9gYAG.d.mts.map +0 -1
- package/dist/wrapper-CE6GQ27z.mjs +0 -3527
- package/dist/wrapper-CE6GQ27z.mjs.map +0 -1
- package/dist/wrappers-JrEYTuKA.mjs.map +0 -1
- package/dist/yoga-adapter-B8LZpQcE.mjs +0 -2
|
@@ -0,0 +1,4305 @@
|
|
|
1
|
+
import { B as bakeFlat, C as COLOR_SCHEME_FIELDS, E as deriveFields, H as ANSI16_SLOT_HEX, S as ansi16LightTheme$1, T as deriveTheme$1, o as detectTheme$1, t as init_src, x as ansi16DarkTheme$1 } from "./src-NCKb8kE5.mjs";
|
|
2
|
+
import { blend, brighten, checkContrast, darken, ensureContrast, hexToOklch, hexToRgb, oklchToHex, relativeLuminance } from "@silvery/color";
|
|
3
|
+
//#region packages/theme/src/generate.ts
|
|
4
|
+
init_src();
|
|
5
|
+
/**
|
|
6
|
+
* Resolve an ANSI16 slot name (e.g. "yellow", "blueBright") to its canonical
|
|
7
|
+
* hex value. Falls back to the input string if not found (e.g., already hex).
|
|
8
|
+
*/
|
|
9
|
+
function slotHex(name) {
|
|
10
|
+
return ANSI16_SLOT_HEX[name] ?? name;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Generate a complete ANSI 16 theme from a primary color + dark/light preference.
|
|
14
|
+
*
|
|
15
|
+
* All token values are hex strings (e.g. "#808000" for yellow).
|
|
16
|
+
* Terminal rendering quantizes these to 4-bit ANSI codes at paint time
|
|
17
|
+
* when colorLevel === "basic".
|
|
18
|
+
*/
|
|
19
|
+
function generateTheme(primary, dark) {
|
|
20
|
+
const primaryHex = slotHex(primary);
|
|
21
|
+
const fgHex = slotHex(dark ? "whiteBright" : "black");
|
|
22
|
+
const accentHex = primaryHex;
|
|
23
|
+
const selectionbgHex = primaryHex;
|
|
24
|
+
const surfacebgHex = slotHex(dark ? "black" : "white");
|
|
25
|
+
const derived = deriveFields({
|
|
26
|
+
primary: primaryHex,
|
|
27
|
+
accent: accentHex,
|
|
28
|
+
fg: fgHex,
|
|
29
|
+
selectionbg: selectionbgHex,
|
|
30
|
+
surfacebg: surfacebgHex,
|
|
31
|
+
ring: {
|
|
32
|
+
red: slotHex(dark ? "redBright" : "red"),
|
|
33
|
+
orange: slotHex(dark ? "redBright" : "red"),
|
|
34
|
+
yellow: slotHex("yellow"),
|
|
35
|
+
green: slotHex(dark ? "greenBright" : "green"),
|
|
36
|
+
teal: slotHex("cyan"),
|
|
37
|
+
blue: slotHex(dark ? "blueBright" : "blue"),
|
|
38
|
+
purple: slotHex("magenta"),
|
|
39
|
+
pink: slotHex(dark ? "magentaBright" : "magenta")
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
name: `${dark ? "dark" : "light"}-${primary}`,
|
|
44
|
+
bg: "",
|
|
45
|
+
fg: fgHex,
|
|
46
|
+
muted: slotHex(dark ? "white" : "blackBright"),
|
|
47
|
+
mutedbg: slotHex(dark ? "black" : "white"),
|
|
48
|
+
surface: slotHex(dark ? "whiteBright" : "black"),
|
|
49
|
+
surfacebg: surfacebgHex,
|
|
50
|
+
popover: slotHex(dark ? "whiteBright" : "black"),
|
|
51
|
+
popoverbg: slotHex(dark ? "blackBright" : "white"),
|
|
52
|
+
inverse: slotHex(dark ? "black" : "whiteBright"),
|
|
53
|
+
inversebg: slotHex(dark ? "whiteBright" : "black"),
|
|
54
|
+
cursor: slotHex("black"),
|
|
55
|
+
cursorbg: primaryHex,
|
|
56
|
+
selection: slotHex("black"),
|
|
57
|
+
selectionbg: primaryHex,
|
|
58
|
+
primary: primaryHex,
|
|
59
|
+
primaryfg: slotHex("black"),
|
|
60
|
+
secondary: primaryHex,
|
|
61
|
+
secondaryfg: slotHex("black"),
|
|
62
|
+
accent: primaryHex,
|
|
63
|
+
accentfg: slotHex("black"),
|
|
64
|
+
error: slotHex(dark ? "redBright" : "red"),
|
|
65
|
+
errorfg: slotHex("black"),
|
|
66
|
+
warning: primaryHex,
|
|
67
|
+
warningfg: slotHex("black"),
|
|
68
|
+
success: slotHex(dark ? "greenBright" : "green"),
|
|
69
|
+
successfg: slotHex("black"),
|
|
70
|
+
info: slotHex(dark ? "cyanBright" : "cyan"),
|
|
71
|
+
infofg: slotHex("black"),
|
|
72
|
+
border: slotHex("gray"),
|
|
73
|
+
inputborder: slotHex("gray"),
|
|
74
|
+
focusborder: slotHex(dark ? "blueBright" : "blue"),
|
|
75
|
+
link: slotHex("blueBright"),
|
|
76
|
+
disabledfg: slotHex("gray"),
|
|
77
|
+
palette: [
|
|
78
|
+
slotHex("black"),
|
|
79
|
+
slotHex("red"),
|
|
80
|
+
slotHex("green"),
|
|
81
|
+
slotHex("yellow"),
|
|
82
|
+
slotHex("blue"),
|
|
83
|
+
slotHex("magenta"),
|
|
84
|
+
slotHex("cyan"),
|
|
85
|
+
slotHex("white"),
|
|
86
|
+
slotHex("blackBright"),
|
|
87
|
+
slotHex("redBright"),
|
|
88
|
+
slotHex("greenBright"),
|
|
89
|
+
slotHex("yellowBright"),
|
|
90
|
+
slotHex("blueBright"),
|
|
91
|
+
slotHex("magentaBright"),
|
|
92
|
+
slotHex("cyanBright"),
|
|
93
|
+
slotHex("whiteBright")
|
|
94
|
+
],
|
|
95
|
+
...derived
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region packages/theme/src/import/types.ts
|
|
100
|
+
/** All Base16 color keys in order. */
|
|
101
|
+
const BASE16_KEYS = [
|
|
102
|
+
"base00",
|
|
103
|
+
"base01",
|
|
104
|
+
"base02",
|
|
105
|
+
"base03",
|
|
106
|
+
"base04",
|
|
107
|
+
"base05",
|
|
108
|
+
"base06",
|
|
109
|
+
"base07",
|
|
110
|
+
"base08",
|
|
111
|
+
"base09",
|
|
112
|
+
"base0A",
|
|
113
|
+
"base0B",
|
|
114
|
+
"base0C",
|
|
115
|
+
"base0D",
|
|
116
|
+
"base0E",
|
|
117
|
+
"base0F"
|
|
118
|
+
];
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region packages/theme/src/import/base16.ts
|
|
121
|
+
/**
|
|
122
|
+
* Import Base16 YAML/JSON schemes into ColorScheme format.
|
|
123
|
+
*
|
|
124
|
+
* Base16 defines 16 colors (base00–base0F). We map them to ColorScheme's
|
|
125
|
+
* 22 colors, deriving bright variants and special colors.
|
|
126
|
+
*
|
|
127
|
+
* @see https://github.com/chriskempson/base16
|
|
128
|
+
*/
|
|
129
|
+
/**
|
|
130
|
+
* Parse Base16 YAML into a Base16Scheme object.
|
|
131
|
+
* Handles both quoted and unquoted values, comments, and blank lines.
|
|
132
|
+
*/
|
|
133
|
+
function parseBase16Yaml(yaml) {
|
|
134
|
+
const result = {};
|
|
135
|
+
for (const raw of yaml.split("\n")) {
|
|
136
|
+
const line = raw.trim();
|
|
137
|
+
if (!line || line.startsWith("#")) continue;
|
|
138
|
+
const colonIdx = line.indexOf(":");
|
|
139
|
+
if (colonIdx === -1) continue;
|
|
140
|
+
const key = line.slice(0, colonIdx).trim();
|
|
141
|
+
let value = line.slice(colonIdx + 1).trim();
|
|
142
|
+
if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
|
|
143
|
+
const commentIdx = value.indexOf("#");
|
|
144
|
+
if (commentIdx > 0) value = value.slice(0, commentIdx).trim();
|
|
145
|
+
result[key] = value;
|
|
146
|
+
}
|
|
147
|
+
if (!result.scheme) throw new Error("Base16 YAML missing required field: scheme");
|
|
148
|
+
for (const key of BASE16_KEYS) {
|
|
149
|
+
if (!result[key]) throw new Error(`Base16 YAML missing required color: ${key}`);
|
|
150
|
+
if (!/^[0-9a-fA-F]{6}$/.test(result[key])) throw new Error(`Base16 color ${key} must be a 6-digit hex string without '#', got: "${result[key]}"`);
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
/** Compute relative luminance (WCAG 2.0) from a hex color with `#` prefix. */
|
|
155
|
+
function luminance(hex) {
|
|
156
|
+
const rgb = hexToRgb(hex);
|
|
157
|
+
if (!rgb) return 0;
|
|
158
|
+
const [r, g, b] = rgb.map((c) => {
|
|
159
|
+
const s = c / 255;
|
|
160
|
+
return s <= .03928 ? s / 12.92 : Math.pow((s + .055) / 1.055, 2.4);
|
|
161
|
+
});
|
|
162
|
+
return .2126 * r + .7152 * g + .0722 * b;
|
|
163
|
+
}
|
|
164
|
+
/** Normalize a bare hex string to `#RRGGBB` (uppercase). */
|
|
165
|
+
function hex(bare) {
|
|
166
|
+
return `#${bare.toUpperCase()}`;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Import a Base16 YAML (or JSON) scheme into a ColorScheme.
|
|
170
|
+
*
|
|
171
|
+
* Mapping:
|
|
172
|
+
* base00 → background, base01 → brightBlack, base02 → selectionBackground,
|
|
173
|
+
* base03 → white (muted fg), base05 → foreground/brightWhite,
|
|
174
|
+
* base08 → red, base09 → brightRed, base0A → yellow,
|
|
175
|
+
* base0B → green, base0C → cyan, base0D → blue, base0E → magenta,
|
|
176
|
+
* base0F → brightMagenta.
|
|
177
|
+
*
|
|
178
|
+
* Bright color variants are derived by brightening normals.
|
|
179
|
+
* `dark` is inferred from base00 luminance.
|
|
180
|
+
*/
|
|
181
|
+
function importBase16(yamlOrJson) {
|
|
182
|
+
return base16ToColorScheme(parseBase16Yaml(yamlOrJson));
|
|
183
|
+
}
|
|
184
|
+
/** Convert a parsed Base16Scheme to ColorScheme. */
|
|
185
|
+
function base16ToColorScheme(scheme) {
|
|
186
|
+
const bg = hex(scheme.base00);
|
|
187
|
+
const fg = hex(scheme.base05);
|
|
188
|
+
const isDark = luminance(bg) < .179;
|
|
189
|
+
const black = isDark ? darken(bg, .15) : brighten(bg, .15);
|
|
190
|
+
const red = hex(scheme.base08);
|
|
191
|
+
const green = hex(scheme.base0B);
|
|
192
|
+
const yellow = hex(scheme.base0A);
|
|
193
|
+
const blue = hex(scheme.base0D);
|
|
194
|
+
const magenta = hex(scheme.base0E);
|
|
195
|
+
const cyan = hex(scheme.base0C);
|
|
196
|
+
return {
|
|
197
|
+
name: scheme.scheme,
|
|
198
|
+
dark: isDark,
|
|
199
|
+
black,
|
|
200
|
+
red,
|
|
201
|
+
green,
|
|
202
|
+
yellow,
|
|
203
|
+
blue,
|
|
204
|
+
magenta,
|
|
205
|
+
cyan,
|
|
206
|
+
white: hex(scheme.base03),
|
|
207
|
+
brightBlack: hex(scheme.base01),
|
|
208
|
+
brightRed: hex(scheme.base09),
|
|
209
|
+
brightGreen: brighten(green, .15),
|
|
210
|
+
brightYellow: brighten(yellow, .15),
|
|
211
|
+
brightBlue: brighten(blue, .15),
|
|
212
|
+
brightMagenta: hex(scheme.base0F),
|
|
213
|
+
brightCyan: brighten(cyan, .15),
|
|
214
|
+
brightWhite: fg,
|
|
215
|
+
foreground: fg,
|
|
216
|
+
background: bg,
|
|
217
|
+
cursorColor: fg,
|
|
218
|
+
cursorText: bg,
|
|
219
|
+
selectionBackground: hex(scheme.base02),
|
|
220
|
+
selectionForeground: fg
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region packages/theme/src/sterling/contrast.ts
|
|
225
|
+
/**
|
|
226
|
+
* Sterling contrast guardrails — D3 from sterling-preflight.md.
|
|
227
|
+
*
|
|
228
|
+
* Two modes:
|
|
229
|
+
* - `strict` — throw when a core role pair fails WCAG AA 4.5:1.
|
|
230
|
+
* Used by the catalog test (all 84 shipped schemes must pass).
|
|
231
|
+
* - `auto-lift` — adjust OKLCH lightness until AA passes (±0.04L increments
|
|
232
|
+
* up to ~0.20L). Logs at debug; silent by default. Used for user schemes
|
|
233
|
+
* at runtime.
|
|
234
|
+
*
|
|
235
|
+
* Pinned tokens (per-role overrides supplied by scheme authors) are excluded
|
|
236
|
+
* from auto-lift and from strict-mode enforcement — the author accepts the
|
|
237
|
+
* contrast consequence of pinning.
|
|
238
|
+
*/
|
|
239
|
+
/** WCAG AA threshold for normal text. */
|
|
240
|
+
const WCAG_AA = 4.5;
|
|
241
|
+
var ContrastError = class extends Error {
|
|
242
|
+
violations;
|
|
243
|
+
constructor(violations) {
|
|
244
|
+
const summary = violations.slice(0, 5).map((v) => `${v.token}: ${v.ratio.toFixed(2)} < ${v.target} (fg=${v.fg}, bg=${v.bg})`).join("; ");
|
|
245
|
+
const extra = violations.length > 5 ? ` (+${violations.length - 5} more)` : "";
|
|
246
|
+
super(`Sterling contrast: ${violations.length} violation(s): ${summary}${extra}`);
|
|
247
|
+
this.name = "ContrastError";
|
|
248
|
+
this.violations = violations;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Verify `fg` on `bg` meets `target` ratio. Returns `null` when already
|
|
253
|
+
* passing; otherwise returns a ContrastViolation.
|
|
254
|
+
*/
|
|
255
|
+
function checkAA(token, fg, bg, target = WCAG_AA) {
|
|
256
|
+
const r = checkContrast(fg, bg);
|
|
257
|
+
if (!r) return null;
|
|
258
|
+
if (r.ratio >= target) return null;
|
|
259
|
+
return {
|
|
260
|
+
token,
|
|
261
|
+
fg,
|
|
262
|
+
bg,
|
|
263
|
+
ratio: r.ratio,
|
|
264
|
+
target
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Auto-lift `fg` against `bg` until the `target` contrast ratio is met,
|
|
269
|
+
* via OKLCH L shifts (hue + chroma preserved). Light bg → darken;
|
|
270
|
+
* dark bg → lighten.
|
|
271
|
+
*
|
|
272
|
+
* Implementation note: binary-searches the minimum L shift achieving the
|
|
273
|
+
* target. Falls back to a best-effort value if the target is unreachable
|
|
274
|
+
* (e.g., yellow against white can never hit 4.5:1 at any lightness while
|
|
275
|
+
* preserving yellow hue; the result is the darkest in-gamut yellow).
|
|
276
|
+
*/
|
|
277
|
+
function autoLift(fg, bg, target = WCAG_AA) {
|
|
278
|
+
const current = checkContrast(fg, bg);
|
|
279
|
+
if (!current) return {
|
|
280
|
+
value: fg,
|
|
281
|
+
lifted: false
|
|
282
|
+
};
|
|
283
|
+
if (current.ratio >= target) return {
|
|
284
|
+
value: fg,
|
|
285
|
+
lifted: false
|
|
286
|
+
};
|
|
287
|
+
const adjusted = ensureContrast(fg, bg, target);
|
|
288
|
+
return {
|
|
289
|
+
value: adjusted,
|
|
290
|
+
lifted: adjusted !== fg
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region packages/theme/src/sterling/derive.ts
|
|
295
|
+
/**
|
|
296
|
+
* Sterling derivation — preservative OKLCH rules over a 22-color ColorScheme.
|
|
297
|
+
*
|
|
298
|
+
* Implements design-system.md §"Derivation rules" with guardrails from D3.
|
|
299
|
+
* Produces the nested `Roles` shape. `flatten.ts` projects the flat keys.
|
|
300
|
+
*
|
|
301
|
+
* Derivation is:
|
|
302
|
+
* 1. `scheme.primary` (or fallback) → accent.fg / accent.bg / info.fg
|
|
303
|
+
* 2. status roles from `scheme.red / yellow / green / primary`
|
|
304
|
+
* 3. Adaptive OKLCH hover/active L-shift (direction = base-L, not scheme.dark):
|
|
305
|
+
* baseL > 0.6 → darken (hover −0.04L, active −0.08L)
|
|
306
|
+
* baseL ≤ 0.6 → brighten (hover +0.04L, active +0.08L)
|
|
307
|
+
* At L extremes (target L > 0.9 or < 0.1) chroma is proportionally
|
|
308
|
+
* reduced so the color pushes toward gray instead of collapsing to
|
|
309
|
+
* white/black — fixes the Frappe yellow/light-accent whiteout.
|
|
310
|
+
* 4. `fgOn` picked for WCAG AA against role's `bg` (prefers scheme bg/fg)
|
|
311
|
+
* 5. surface ramp via OKLCH blend
|
|
312
|
+
* 6. contrast guardrail: strict throws, auto-lift adjusts
|
|
313
|
+
*
|
|
314
|
+
* Per-hue delta adaptation: yellows (H ∈ [80, 110]) get ±0.06L / ±0.10L,
|
|
315
|
+
* low-chroma schemes (C < 0.05) get ±0.06L / ±0.10L. Everything else uses
|
|
316
|
+
* the standard ±0.04L / ±0.08L.
|
|
317
|
+
*
|
|
318
|
+
* Pinned tokens (via `DeriveOptions.pins`) bypass both the rule and
|
|
319
|
+
* auto-lift; they're written verbatim onto the Theme.
|
|
320
|
+
*/
|
|
321
|
+
/**
|
|
322
|
+
* Default typography variants — token-based, works across any Sterling theme.
|
|
323
|
+
* Consumed by `<Text variant="h1">` via the theme's `variants` record.
|
|
324
|
+
*
|
|
325
|
+
* Keys use Sterling flat-token names in their color slots (`$fg-accent`,
|
|
326
|
+
* `$fg-muted`, `$bg-muted`) so the defaults resolve against every Sterling-
|
|
327
|
+
* derived Theme without further wiring.
|
|
328
|
+
*/
|
|
329
|
+
const DEFAULT_VARIANTS = {
|
|
330
|
+
h1: {
|
|
331
|
+
color: "$fg-accent",
|
|
332
|
+
bold: true
|
|
333
|
+
},
|
|
334
|
+
h2: {
|
|
335
|
+
color: "$fg-accent",
|
|
336
|
+
bold: true
|
|
337
|
+
},
|
|
338
|
+
h3: { bold: true },
|
|
339
|
+
body: {},
|
|
340
|
+
"body-muted": { color: "$fg-muted" },
|
|
341
|
+
"fine-print": {
|
|
342
|
+
color: "$fg-muted",
|
|
343
|
+
dim: true
|
|
344
|
+
},
|
|
345
|
+
strong: { bold: true },
|
|
346
|
+
em: { italic: true },
|
|
347
|
+
link: {
|
|
348
|
+
color: "$fg-accent",
|
|
349
|
+
underlineStyle: "single"
|
|
350
|
+
},
|
|
351
|
+
key: {
|
|
352
|
+
color: "$fg-accent",
|
|
353
|
+
bold: true
|
|
354
|
+
},
|
|
355
|
+
code: { backgroundColor: "$bg-muted" },
|
|
356
|
+
kbd: {
|
|
357
|
+
backgroundColor: "$bg-muted",
|
|
358
|
+
color: "$fg-accent",
|
|
359
|
+
bold: true
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* Build the 16-slot ANSI palette from a ColorScheme. Indexed `$color0` …
|
|
364
|
+
* `$color15` by the framework's token resolver.
|
|
365
|
+
*/
|
|
366
|
+
function buildPalette(scheme) {
|
|
367
|
+
return [
|
|
368
|
+
scheme.black,
|
|
369
|
+
scheme.red,
|
|
370
|
+
scheme.green,
|
|
371
|
+
scheme.yellow,
|
|
372
|
+
scheme.blue,
|
|
373
|
+
scheme.magenta,
|
|
374
|
+
scheme.cyan,
|
|
375
|
+
scheme.white,
|
|
376
|
+
scheme.brightBlack,
|
|
377
|
+
scheme.brightRed,
|
|
378
|
+
scheme.brightGreen,
|
|
379
|
+
scheme.brightYellow,
|
|
380
|
+
scheme.brightBlue,
|
|
381
|
+
scheme.brightMagenta,
|
|
382
|
+
scheme.brightCyan,
|
|
383
|
+
scheme.brightWhite
|
|
384
|
+
];
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Derive the 8-hue categorical ring from a ColorScheme. Mirrors the legacy
|
|
388
|
+
* derive.ts logic — blends scheme hues for the missing Sterling slots
|
|
389
|
+
* (orange from red+yellow, teal from green+cyan, pink from magenta+red).
|
|
390
|
+
*/
|
|
391
|
+
function buildCategoricalHues(scheme) {
|
|
392
|
+
const dark = scheme.dark ?? true;
|
|
393
|
+
return {
|
|
394
|
+
red: scheme.red,
|
|
395
|
+
orange: blend(scheme.red, scheme.yellow, .5),
|
|
396
|
+
yellow: scheme.yellow,
|
|
397
|
+
green: scheme.green,
|
|
398
|
+
teal: blend(scheme.green, scheme.cyan, .5),
|
|
399
|
+
blue: dark ? scheme.brightBlue : scheme.blue,
|
|
400
|
+
purple: scheme.magenta,
|
|
401
|
+
pink: blend(scheme.magenta, scheme.red, .5)
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function isYellowish(hex) {
|
|
405
|
+
const o = hexToOklch(hex);
|
|
406
|
+
if (!o) return false;
|
|
407
|
+
return o.H >= 80 && o.H <= 120;
|
|
408
|
+
}
|
|
409
|
+
function isLowChroma(hex) {
|
|
410
|
+
const o = hexToOklch(hex);
|
|
411
|
+
if (!o) return false;
|
|
412
|
+
return o.C < .05;
|
|
413
|
+
}
|
|
414
|
+
/** Compute state-shift deltas for a given base color. Wider for yellows + low-chroma. */
|
|
415
|
+
function stateDeltas(base) {
|
|
416
|
+
if (isYellowish(base) || isLowChroma(base)) return {
|
|
417
|
+
hover: .06,
|
|
418
|
+
active: .1
|
|
419
|
+
};
|
|
420
|
+
return {
|
|
421
|
+
hover: .04,
|
|
422
|
+
active: .08
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Adaptive L-shift: direction follows the token's own luminance, NOT
|
|
427
|
+
* scheme.dark. High-L tokens (yellows, light accents) darken; low-L tokens
|
|
428
|
+
* brighten. Uniform handling — yields a reliable "more active than hover"
|
|
429
|
+
* relationship no matter what hue/lightness the base is.
|
|
430
|
+
*
|
|
431
|
+
* Chroma preservation at L extremes: when the target L pushes past 0.9
|
|
432
|
+
* (approaching white) or below 0.1 (approaching black), chroma is scaled
|
|
433
|
+
* down proportionally so the color drifts toward gray rather than
|
|
434
|
+
* collapsing to #FFFFFF or #000000. This preserves perceptual differences
|
|
435
|
+
* between the base / hover / active states even on intrinsically-bright
|
|
436
|
+
* tokens (catppuccin-frappe yellow, light blue accents, etc.).
|
|
437
|
+
*
|
|
438
|
+
* Returns the original hex unchanged when OKLCH parsing fails.
|
|
439
|
+
*/
|
|
440
|
+
function shiftL(hex, amount) {
|
|
441
|
+
const o = hexToOklch(hex);
|
|
442
|
+
if (!o) return hex;
|
|
443
|
+
const direction = o.L > .6 ? -1 : 1;
|
|
444
|
+
const targetL = clamp01(o.L + direction * amount);
|
|
445
|
+
let nextC = o.C;
|
|
446
|
+
if (targetL > .9 || targetL < .1) {
|
|
447
|
+
const factor = clamp01(1 - Math.abs(targetL - .5) * 2);
|
|
448
|
+
nextC = o.C * factor;
|
|
449
|
+
}
|
|
450
|
+
return oklchToHex({
|
|
451
|
+
L: targetL,
|
|
452
|
+
C: nextC,
|
|
453
|
+
H: o.H
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function clamp01(x) {
|
|
457
|
+
return x < 0 ? 0 : x > 1 ? 1 : x;
|
|
458
|
+
}
|
|
459
|
+
/** Label the direction the adaptive L-shift took, for trace rule strings. */
|
|
460
|
+
function shiftLabel(hex) {
|
|
461
|
+
const o = hexToOklch(hex);
|
|
462
|
+
if (!o) return "brighten";
|
|
463
|
+
return o.L > .6 ? "darken" : "brighten";
|
|
464
|
+
}
|
|
465
|
+
function inferMode(scheme, explicit) {
|
|
466
|
+
if (explicit) return explicit;
|
|
467
|
+
if (typeof scheme.dark === "boolean") return scheme.dark ? "dark" : "light";
|
|
468
|
+
const lum = relativeLuminance(scheme.background);
|
|
469
|
+
return lum !== null && lum < .5 ? "dark" : "light";
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Pick a foreground color to draw on a filled `bg` of a role. Prefers
|
|
473
|
+
* `scheme.background` if it beats AA against the role bg (i.e. the role bg
|
|
474
|
+
* is bright enough that using dark text reads); otherwise `scheme.foreground`;
|
|
475
|
+
* otherwise falls back to white/black by bg luminance.
|
|
476
|
+
*/
|
|
477
|
+
function pickFgOn(roleBg, scheme) {
|
|
478
|
+
const candidates = [
|
|
479
|
+
scheme.foreground,
|
|
480
|
+
scheme.background,
|
|
481
|
+
"#FFFFFF",
|
|
482
|
+
"#000000"
|
|
483
|
+
];
|
|
484
|
+
let best = candidates[0];
|
|
485
|
+
let bestRatio = 0;
|
|
486
|
+
for (const c of candidates) {
|
|
487
|
+
const r = checkAA("fgOn", c, roleBg);
|
|
488
|
+
if (r === null) return c;
|
|
489
|
+
if (r.ratio > bestRatio) {
|
|
490
|
+
best = c;
|
|
491
|
+
bestRatio = r.ratio;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return best;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Resolve a pin for a token path. Accepts both nested (`"accent.hover.bg"`)
|
|
498
|
+
* and flat (`"bg-accent-hover"`) forms. Returns the pinned hex or undefined.
|
|
499
|
+
*/
|
|
500
|
+
function pin(pins, nested, flat) {
|
|
501
|
+
if (!pins) return void 0;
|
|
502
|
+
return pins[nested] ?? pins[flat];
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Shared guard: handles pin → rule → contrast check → auto-lift → record.
|
|
506
|
+
* `target` defaults to WCAG_AA (4.5); callers use 3.0 for "muted" tokens
|
|
507
|
+
* that are deemphasized by design.
|
|
508
|
+
*/
|
|
509
|
+
function guardTarget(nestedPath, flatPath, rule, inputs, value, against, target, contrast, pins, trace, violations) {
|
|
510
|
+
const pinned = pin(pins, nestedPath, flatPath);
|
|
511
|
+
if (pinned !== void 0) {
|
|
512
|
+
trace.push({
|
|
513
|
+
token: nestedPath,
|
|
514
|
+
rule: "pinned by scheme author",
|
|
515
|
+
inputs: [pinned],
|
|
516
|
+
output: pinned,
|
|
517
|
+
pinned: true
|
|
518
|
+
});
|
|
519
|
+
return pinned;
|
|
520
|
+
}
|
|
521
|
+
if (against === void 0) {
|
|
522
|
+
trace.push({
|
|
523
|
+
token: nestedPath,
|
|
524
|
+
rule,
|
|
525
|
+
inputs,
|
|
526
|
+
output: value
|
|
527
|
+
});
|
|
528
|
+
return value;
|
|
529
|
+
}
|
|
530
|
+
if (checkAA(nestedPath, value, against, target) === null) {
|
|
531
|
+
trace.push({
|
|
532
|
+
token: nestedPath,
|
|
533
|
+
rule,
|
|
534
|
+
inputs,
|
|
535
|
+
output: value
|
|
536
|
+
});
|
|
537
|
+
return value;
|
|
538
|
+
}
|
|
539
|
+
const lifted = autoLift(value, against, target);
|
|
540
|
+
const finalValue = lifted.value;
|
|
541
|
+
const residual = checkAA(nestedPath, finalValue, against, target);
|
|
542
|
+
if (residual !== null) violations.push(residual);
|
|
543
|
+
trace.push({
|
|
544
|
+
token: nestedPath,
|
|
545
|
+
rule: lifted.lifted ? `${rule} + auto-lift` : rule,
|
|
546
|
+
inputs,
|
|
547
|
+
output: finalValue,
|
|
548
|
+
...lifted.lifted ? { liftedFrom: value } : {}
|
|
549
|
+
});
|
|
550
|
+
return finalValue;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Derive a Theme's nested roles from a ColorScheme. Guardrails applied.
|
|
554
|
+
*/
|
|
555
|
+
function deriveRoles(scheme, opts) {
|
|
556
|
+
const mode = inferMode(scheme, opts.mode);
|
|
557
|
+
const contrast = opts.contrast ?? "auto-lift";
|
|
558
|
+
const pins = opts.pins;
|
|
559
|
+
const trace = [];
|
|
560
|
+
const violations = [];
|
|
561
|
+
const primary = scheme.primary ?? (mode === "dark" ? scheme.brightBlue : scheme.blue);
|
|
562
|
+
const bg = scheme.background;
|
|
563
|
+
const fg = scheme.foreground;
|
|
564
|
+
function guard(nestedPath, flatPath, rule, inputs, value, against, target = WCAG_AA) {
|
|
565
|
+
return guardTarget(nestedPath, flatPath, rule, inputs, value, against, target, contrast, pins, trace, violations);
|
|
566
|
+
}
|
|
567
|
+
const accentBase = guard("accent.fg", "fg-accent", "scheme.primary", [primary], primary, bg);
|
|
568
|
+
const accentBg = guard("accent.bg", "bg-accent", "scheme.primary", [primary], primary);
|
|
569
|
+
const deltaA = stateDeltas(accentBg);
|
|
570
|
+
const bgDir = shiftLabel(accentBg);
|
|
571
|
+
const accentHoverBg = guard("accent.hover.bg", "bg-accent-hover", `OKLCH ${bgDir} ${deltaA.hover}L on accent.bg`, [accentBg], shiftL(accentBg, deltaA.hover));
|
|
572
|
+
const accentActiveBg = guard("accent.active.bg", "bg-accent-active", `OKLCH ${bgDir} ${deltaA.active}L on accent.bg`, [accentBg], shiftL(accentBg, deltaA.active));
|
|
573
|
+
const accentFgOn = guard("accent.fgOn", "fg-on-accent", "contrast-pick(scheme.fg/bg/BW)", [accentBg], pickFgOn(accentBg, scheme), accentBg);
|
|
574
|
+
const accentBorder = guard("accent.border", "border-accent", "= accent.bg", [accentBg], accentBg);
|
|
575
|
+
const fgDir = shiftLabel(accentBase);
|
|
576
|
+
const accentHoverFg = guard("accent.hover.fg", "fg-accent-hover", `OKLCH ${fgDir} ${deltaA.hover}L on accent.fg`, [accentBase], shiftL(accentBase, deltaA.hover), bg);
|
|
577
|
+
const accentActiveFg = guard("accent.active.fg", "fg-accent-active", `OKLCH ${fgDir} ${deltaA.active}L on accent.fg`, [accentBase], shiftL(accentBase, deltaA.active), bg);
|
|
578
|
+
return {
|
|
579
|
+
roles: {
|
|
580
|
+
accent: {
|
|
581
|
+
fg: accentBase,
|
|
582
|
+
bg: accentBg,
|
|
583
|
+
fgOn: accentFgOn,
|
|
584
|
+
border: accentBorder,
|
|
585
|
+
hover: {
|
|
586
|
+
fg: accentHoverFg,
|
|
587
|
+
bg: accentHoverBg
|
|
588
|
+
},
|
|
589
|
+
active: {
|
|
590
|
+
fg: accentActiveFg,
|
|
591
|
+
bg: accentActiveBg
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
info: buildInteractive("info", primary, scheme, opts, trace, violations),
|
|
595
|
+
success: buildInteractive("success", scheme.green, scheme, opts, trace, violations),
|
|
596
|
+
warning: buildInteractive("warning", scheme.yellow, scheme, opts, trace, violations),
|
|
597
|
+
error: buildInteractive("error", scheme.red, scheme, opts, trace, violations),
|
|
598
|
+
muted: {
|
|
599
|
+
fg: guard("muted.fg", "fg-muted", "blend(fg, bg, 0.4)", [fg, bg], blend(fg, bg, .4), bg, 3),
|
|
600
|
+
bg: guard("muted.bg", "bg-muted", "blend(bg, fg, 0.08)", [bg, fg], blend(bg, fg, .08))
|
|
601
|
+
},
|
|
602
|
+
surface: {
|
|
603
|
+
default: guard("surface.default", "bg-surface-default", "scheme.background", [bg], bg),
|
|
604
|
+
subtle: guard("surface.subtle", "bg-surface-subtle", "blend(bg, fg, 0.05)", [bg, fg], blend(bg, fg, .05)),
|
|
605
|
+
raised: guard("surface.raised", "bg-surface-raised", "blend(bg, fg, 0.08)", [bg, fg], blend(bg, fg, .08)),
|
|
606
|
+
overlay: guard("surface.overlay", "bg-surface-overlay", "blend(bg, fg, 0.12)", [bg, fg], blend(bg, fg, .12)),
|
|
607
|
+
hover: guard("surface.hover", "bg-surface-hover", "blend(bg, fg, 0.10)", [bg, fg], blend(bg, fg, .1))
|
|
608
|
+
},
|
|
609
|
+
border: {
|
|
610
|
+
default: guard("border.default", "border-default", "blend(bg, fg, 0.18)", [bg, fg], blend(bg, fg, .18)),
|
|
611
|
+
focus: guard("border.focus", "border-focus", "= accent.bg", [accentBg], accentBg, bg),
|
|
612
|
+
muted: guard("border.muted", "border-muted", "blend(bg, fg, 0.10)", [bg, fg], blend(bg, fg, .1))
|
|
613
|
+
},
|
|
614
|
+
cursor: {
|
|
615
|
+
fg: guard("cursor.fg", "fg-cursor", "scheme.cursorText", [scheme.cursorText], scheme.cursorText),
|
|
616
|
+
bg: guard("cursor.bg", "bg-cursor", "scheme.cursorColor", [scheme.cursorColor], scheme.cursorColor)
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
mode,
|
|
620
|
+
trace,
|
|
621
|
+
violations
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
function buildInteractive(name, seed, scheme, opts, trace, violations) {
|
|
625
|
+
const pins = opts.pins;
|
|
626
|
+
const contrast = opts.contrast ?? "auto-lift";
|
|
627
|
+
const bg = scheme.background;
|
|
628
|
+
const guard = (nestedPath, flatPath, rule, inputs, value, against, target = WCAG_AA) => guardTarget(nestedPath, flatPath, rule, inputs, value, against, target, contrast, pins, trace, violations);
|
|
629
|
+
const fg = guard(`${name}.fg`, `fg-${name}`, seedRule(name), [seed], seed, bg);
|
|
630
|
+
const roleBg = guard(`${name}.bg`, `bg-${name}`, seedRule(name), [seed], seed);
|
|
631
|
+
const delta = stateDeltas(roleBg);
|
|
632
|
+
const bgDir = shiftLabel(roleBg);
|
|
633
|
+
const fgOn = guard(`${name}.fgOn`, `fg-on-${name}`, "contrast-pick(scheme.fg/bg/BW)", [roleBg], pickFgOn(roleBg, scheme), roleBg);
|
|
634
|
+
const hoverBg = guard(`${name}.hover.bg`, `bg-${name}-hover`, `OKLCH ${bgDir} ${delta.hover}L`, [roleBg], shiftL(roleBg, delta.hover));
|
|
635
|
+
const activeBg = guard(`${name}.active.bg`, `bg-${name}-active`, `OKLCH ${bgDir} ${delta.active}L`, [roleBg], shiftL(roleBg, delta.active));
|
|
636
|
+
return {
|
|
637
|
+
fg,
|
|
638
|
+
bg: roleBg,
|
|
639
|
+
fgOn,
|
|
640
|
+
hover: { bg: hoverBg },
|
|
641
|
+
active: { bg: activeBg }
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
function seedRule(name) {
|
|
645
|
+
switch (name) {
|
|
646
|
+
case "info": return "scheme.primary (info mirrors accent's seed, derived independently)";
|
|
647
|
+
case "success": return "scheme.green";
|
|
648
|
+
case "warning": return "scheme.yellow";
|
|
649
|
+
case "error": return "scheme.red";
|
|
650
|
+
case "accent": return "scheme.primary";
|
|
651
|
+
default: return `scheme.${name}`;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Derive a full Theme (pre-flatten) from a ColorScheme. Throws `ContrastError`
|
|
656
|
+
* in strict mode if any role pair fails WCAG AA. Callers typically wrap this
|
|
657
|
+
* with `flatten()` (from `flatten.ts`) to get the user-facing Theme.
|
|
658
|
+
*
|
|
659
|
+
* Returned Theme is NOT frozen and DOES NOT contain flat keys yet.
|
|
660
|
+
*/
|
|
661
|
+
function deriveTheme(scheme, opts = {}) {
|
|
662
|
+
const { roles, mode, trace, violations } = deriveRoles(scheme, opts);
|
|
663
|
+
if ((opts.contrast ?? "auto-lift") === "strict" && violations.length > 0) throw new ContrastError(violations);
|
|
664
|
+
return {
|
|
665
|
+
...roles,
|
|
666
|
+
...buildCategoricalHues(scheme),
|
|
667
|
+
name: scheme.name,
|
|
668
|
+
mode,
|
|
669
|
+
variants: DEFAULT_VARIANTS,
|
|
670
|
+
palette: buildPalette(scheme),
|
|
671
|
+
...opts.trace ? { derivationTrace: trace } : {}
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Merge a DeepPartial<Theme> onto an existing Theme (for `sterling.theme()`).
|
|
676
|
+
* Nested role objects are spread deeply; flat keys are replaced if present.
|
|
677
|
+
*/
|
|
678
|
+
function mergePartial(base, patch) {
|
|
679
|
+
if (!patch) return base;
|
|
680
|
+
const out = { ...base };
|
|
681
|
+
for (const [k, v] of Object.entries(patch)) {
|
|
682
|
+
if (v === void 0) continue;
|
|
683
|
+
const cur = base[k];
|
|
684
|
+
if (cur && typeof cur === "object" && typeof v === "object" && !Array.isArray(v)) {
|
|
685
|
+
out[k] = {
|
|
686
|
+
...cur,
|
|
687
|
+
...v
|
|
688
|
+
};
|
|
689
|
+
for (const [k2, v2] of Object.entries(v)) if (v2 && typeof v2 === "object" && !Array.isArray(v2) && cur[k2] && typeof cur[k2] === "object") out[k][k2] = {
|
|
690
|
+
...cur[k2],
|
|
691
|
+
...v2
|
|
692
|
+
};
|
|
693
|
+
} else out[k] = v;
|
|
694
|
+
}
|
|
695
|
+
return out;
|
|
696
|
+
}
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region packages/theme/src/sterling/inline.ts
|
|
699
|
+
/**
|
|
700
|
+
* Build a ColorScheme-shaped input from a legacy Theme when the original
|
|
701
|
+
* scheme isn't available (hand-crafted themes, picker round-trips).
|
|
702
|
+
*/
|
|
703
|
+
function schemeFromLegacy(theme) {
|
|
704
|
+
const palette = theme.palette ?? [];
|
|
705
|
+
return {
|
|
706
|
+
name: theme.name,
|
|
707
|
+
dark: isDark(theme.bg),
|
|
708
|
+
primary: theme.primary,
|
|
709
|
+
black: palette[0] ?? "#000000",
|
|
710
|
+
red: palette[1] ?? theme.error,
|
|
711
|
+
green: palette[2] ?? theme.success,
|
|
712
|
+
yellow: palette[3] ?? theme.warning,
|
|
713
|
+
blue: palette[4] ?? theme.primary,
|
|
714
|
+
magenta: palette[5] ?? theme.accent,
|
|
715
|
+
cyan: palette[6] ?? theme.info,
|
|
716
|
+
white: palette[7] ?? theme.fg,
|
|
717
|
+
brightBlack: palette[8] ?? theme.muted,
|
|
718
|
+
brightRed: palette[9] ?? theme.error,
|
|
719
|
+
brightGreen: palette[10] ?? theme.success,
|
|
720
|
+
brightYellow: palette[11] ?? theme.warning,
|
|
721
|
+
brightBlue: palette[12] ?? theme.primary,
|
|
722
|
+
brightMagenta: palette[13] ?? theme.accent,
|
|
723
|
+
brightCyan: palette[14] ?? theme.info,
|
|
724
|
+
brightWhite: palette[15] ?? theme.fg,
|
|
725
|
+
foreground: theme.fg,
|
|
726
|
+
background: theme.bg,
|
|
727
|
+
cursorColor: theme.cursorbg,
|
|
728
|
+
cursorText: theme.cursor,
|
|
729
|
+
selectionBackground: theme.selectionbg,
|
|
730
|
+
selectionForeground: theme.selection
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Quick luminance check — matches relativeLuminance threshold (0.5). Avoids
|
|
735
|
+
* pulling in @silvery/color for a single boolean.
|
|
736
|
+
*/
|
|
737
|
+
function isDark(hex) {
|
|
738
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
739
|
+
if (!m?.[1]) return true;
|
|
740
|
+
const n = parseInt(m[1], 16);
|
|
741
|
+
const r = n >> 16 & 255;
|
|
742
|
+
const g = n >> 8 & 255;
|
|
743
|
+
const b = n & 255;
|
|
744
|
+
return (.2126 * r + .7152 * g + .0722 * b) / 255 < .5;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Write Sterling flat tokens onto a legacy Theme in-place and return the
|
|
748
|
+
* augmented object. Mirrors the old `augmentWithSterlingFlat` semantics:
|
|
749
|
+
* only sets a key if it's not already a string on the theme.
|
|
750
|
+
*
|
|
751
|
+
* When `scheme` is provided, Sterling derives directly from it (full fidelity).
|
|
752
|
+
* Otherwise a scheme is reconstructed from the theme's palette (lossy on ANSI
|
|
753
|
+
* slots but fine for Sterling's derivation surface).
|
|
754
|
+
*/
|
|
755
|
+
function inlineSterlingTokens(theme, scheme) {
|
|
756
|
+
const { roles } = deriveRoles(scheme ?? schemeFromLegacy(theme), { contrast: "auto-lift" });
|
|
757
|
+
const out = { ...theme };
|
|
758
|
+
const setIfAbsent = (key, value) => {
|
|
759
|
+
if (!(key in out) || typeof out[key] !== "string") out[key] = value;
|
|
760
|
+
};
|
|
761
|
+
const accent = roles.accent;
|
|
762
|
+
if (accent) {
|
|
763
|
+
setIfAbsent("fg-accent", accent.fg);
|
|
764
|
+
setIfAbsent("bg-accent", accent.bg);
|
|
765
|
+
setIfAbsent("fg-on-accent", accent.fgOn);
|
|
766
|
+
for (const state of ["hover", "active"]) {
|
|
767
|
+
const s = accent[state];
|
|
768
|
+
if (!s) continue;
|
|
769
|
+
setIfAbsent(`fg-accent-${state}`, s.fg);
|
|
770
|
+
setIfAbsent(`bg-accent-${state}`, s.bg);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
for (const role of [
|
|
774
|
+
"info",
|
|
775
|
+
"success",
|
|
776
|
+
"warning",
|
|
777
|
+
"error"
|
|
778
|
+
]) {
|
|
779
|
+
const r = roles[role];
|
|
780
|
+
if (!r) continue;
|
|
781
|
+
setIfAbsent(`fg-${role}`, r.fg);
|
|
782
|
+
setIfAbsent(`bg-${role}`, r.bg);
|
|
783
|
+
setIfAbsent(`fg-on-${role}`, r.fgOn);
|
|
784
|
+
for (const state of ["hover", "active"]) {
|
|
785
|
+
const s = r[state];
|
|
786
|
+
if (!s) continue;
|
|
787
|
+
setIfAbsent(`bg-${role}-${state}`, s.bg);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (roles.accent && "border" in roles.accent) setIfAbsent("border-accent", roles.accent.border);
|
|
791
|
+
const surf = roles.surface;
|
|
792
|
+
if (surf) {
|
|
793
|
+
setIfAbsent("bg-surface-default", surf.default);
|
|
794
|
+
setIfAbsent("bg-surface-subtle", surf.subtle);
|
|
795
|
+
setIfAbsent("bg-surface-raised", surf.raised);
|
|
796
|
+
setIfAbsent("bg-surface-overlay", surf.overlay);
|
|
797
|
+
setIfAbsent("bg-surface-hover", surf.hover);
|
|
798
|
+
}
|
|
799
|
+
const b = roles.border;
|
|
800
|
+
if (b) {
|
|
801
|
+
setIfAbsent("border-default", b.default);
|
|
802
|
+
setIfAbsent("border-focus", b.focus);
|
|
803
|
+
setIfAbsent("border-muted", b.muted);
|
|
804
|
+
}
|
|
805
|
+
const c = roles.cursor;
|
|
806
|
+
if (c) {
|
|
807
|
+
setIfAbsent("fg-cursor", c.fg);
|
|
808
|
+
setIfAbsent("bg-cursor", c.bg);
|
|
809
|
+
}
|
|
810
|
+
const m = roles.muted;
|
|
811
|
+
if (m) {
|
|
812
|
+
setIfAbsent("fg-muted", m.fg);
|
|
813
|
+
setIfAbsent("bg-muted", m.bg);
|
|
814
|
+
}
|
|
815
|
+
return out;
|
|
816
|
+
}
|
|
817
|
+
//#endregion
|
|
818
|
+
//#region packages/theme/src/schemes/catppuccin.ts
|
|
819
|
+
/** Catppuccin Mocha — the classic dark variant. */
|
|
820
|
+
const catppuccinMocha = {
|
|
821
|
+
name: "catppuccin-mocha",
|
|
822
|
+
dark: true,
|
|
823
|
+
black: "#11111B",
|
|
824
|
+
red: "#F38BA8",
|
|
825
|
+
green: "#A6E3A1",
|
|
826
|
+
yellow: "#F9E2AF",
|
|
827
|
+
blue: "#89B4FA",
|
|
828
|
+
magenta: "#CBA6F7",
|
|
829
|
+
cyan: "#94E2D5",
|
|
830
|
+
white: "#A6ADC8",
|
|
831
|
+
brightBlack: "#313244",
|
|
832
|
+
brightRed: "#FAB387",
|
|
833
|
+
brightGreen: brighten("#A6E3A1", .15),
|
|
834
|
+
brightYellow: brighten("#F9E2AF", .15),
|
|
835
|
+
brightBlue: brighten("#89B4FA", .15),
|
|
836
|
+
brightMagenta: "#F5C2E7",
|
|
837
|
+
brightCyan: brighten("#94E2D5", .15),
|
|
838
|
+
brightWhite: "#CDD6F4",
|
|
839
|
+
foreground: "#CDD6F4",
|
|
840
|
+
background: "#1E1E2E",
|
|
841
|
+
cursorColor: "#CDD6F4",
|
|
842
|
+
cursorText: "#1E1E2E",
|
|
843
|
+
selectionBackground: "#6C7086",
|
|
844
|
+
selectionForeground: "#CDD6F4"
|
|
845
|
+
};
|
|
846
|
+
/** Catppuccin Frappe — muted dark variant. */
|
|
847
|
+
const catppuccinFrappe = {
|
|
848
|
+
name: "catppuccin-frappe",
|
|
849
|
+
dark: true,
|
|
850
|
+
black: "#232634",
|
|
851
|
+
red: "#E78284",
|
|
852
|
+
green: "#A6D189",
|
|
853
|
+
yellow: "#E5C890",
|
|
854
|
+
blue: "#8CAAEE",
|
|
855
|
+
magenta: "#CA9EE6",
|
|
856
|
+
cyan: "#81C8BE",
|
|
857
|
+
white: "#A5ADCE",
|
|
858
|
+
brightBlack: "#414559",
|
|
859
|
+
brightRed: "#EF9F76",
|
|
860
|
+
brightGreen: brighten("#A6D189", .15),
|
|
861
|
+
brightYellow: brighten("#E5C890", .15),
|
|
862
|
+
brightBlue: brighten("#8CAAEE", .15),
|
|
863
|
+
brightMagenta: "#F4B8E4",
|
|
864
|
+
brightCyan: brighten("#81C8BE", .15),
|
|
865
|
+
brightWhite: "#C6D0F5",
|
|
866
|
+
foreground: "#C6D0F5",
|
|
867
|
+
background: "#303446",
|
|
868
|
+
cursorColor: "#C6D0F5",
|
|
869
|
+
cursorText: "#303446",
|
|
870
|
+
selectionBackground: "#737994",
|
|
871
|
+
selectionForeground: "#C6D0F5"
|
|
872
|
+
};
|
|
873
|
+
/** Catppuccin Macchiato — warm dark variant. */
|
|
874
|
+
const catppuccinMacchiato = {
|
|
875
|
+
name: "catppuccin-macchiato",
|
|
876
|
+
dark: true,
|
|
877
|
+
black: "#181926",
|
|
878
|
+
red: "#ED8796",
|
|
879
|
+
green: "#A6DA95",
|
|
880
|
+
yellow: "#EED49F",
|
|
881
|
+
blue: "#8AADF4",
|
|
882
|
+
magenta: "#C6A0F6",
|
|
883
|
+
cyan: "#8BD5CA",
|
|
884
|
+
white: "#A5ADCB",
|
|
885
|
+
brightBlack: "#363A4F",
|
|
886
|
+
brightRed: "#F5A97F",
|
|
887
|
+
brightGreen: brighten("#A6DA95", .15),
|
|
888
|
+
brightYellow: brighten("#EED49F", .15),
|
|
889
|
+
brightBlue: brighten("#8AADF4", .15),
|
|
890
|
+
brightMagenta: "#F5BDE6",
|
|
891
|
+
brightCyan: brighten("#8BD5CA", .15),
|
|
892
|
+
brightWhite: "#CAD3F5",
|
|
893
|
+
foreground: "#CAD3F5",
|
|
894
|
+
background: "#24273A",
|
|
895
|
+
cursorColor: "#CAD3F5",
|
|
896
|
+
cursorText: "#24273A",
|
|
897
|
+
selectionBackground: "#6E738D",
|
|
898
|
+
selectionForeground: "#CAD3F5"
|
|
899
|
+
};
|
|
900
|
+
/** Catppuccin Latte — the light variant. */
|
|
901
|
+
const catppuccinLatte = {
|
|
902
|
+
name: "catppuccin-latte",
|
|
903
|
+
dark: false,
|
|
904
|
+
black: "#DCE0E8",
|
|
905
|
+
red: "#D20F39",
|
|
906
|
+
green: "#40A02B",
|
|
907
|
+
yellow: "#DF8E1D",
|
|
908
|
+
blue: "#1E66F5",
|
|
909
|
+
magenta: "#8839EF",
|
|
910
|
+
cyan: "#179299",
|
|
911
|
+
white: "#6C6F85",
|
|
912
|
+
brightBlack: "#CCD0DA",
|
|
913
|
+
brightRed: "#FE640B",
|
|
914
|
+
brightGreen: brighten("#40A02B", .15),
|
|
915
|
+
brightYellow: brighten("#DF8E1D", .15),
|
|
916
|
+
brightBlue: brighten("#1E66F5", .15),
|
|
917
|
+
brightMagenta: "#EA76CB",
|
|
918
|
+
brightCyan: brighten("#179299", .15),
|
|
919
|
+
brightWhite: "#4C4F69",
|
|
920
|
+
foreground: "#4C4F69",
|
|
921
|
+
background: "#EFF1F5",
|
|
922
|
+
cursorColor: "#4C4F69",
|
|
923
|
+
cursorText: "#EFF1F5",
|
|
924
|
+
selectionBackground: "#9CA0B0",
|
|
925
|
+
selectionForeground: "#4C4F69"
|
|
926
|
+
};
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region packages/theme/src/schemes/nord.ts
|
|
929
|
+
/** Nord — the classic dark arctic theme. */
|
|
930
|
+
const nord = {
|
|
931
|
+
name: "nord",
|
|
932
|
+
dark: true,
|
|
933
|
+
black: "#2E3440",
|
|
934
|
+
red: "#BF616A",
|
|
935
|
+
green: "#A3BE8C",
|
|
936
|
+
yellow: "#EBCB8B",
|
|
937
|
+
blue: "#5E81AC",
|
|
938
|
+
magenta: "#B48EAD",
|
|
939
|
+
cyan: "#8FBCBB",
|
|
940
|
+
white: "#D8DEE9",
|
|
941
|
+
brightBlack: "#3B4252",
|
|
942
|
+
brightRed: "#D08770",
|
|
943
|
+
brightGreen: brighten("#A3BE8C", .15),
|
|
944
|
+
brightYellow: brighten("#EBCB8B", .15),
|
|
945
|
+
brightBlue: brighten("#5E81AC", .15),
|
|
946
|
+
brightMagenta: "#B48EAD",
|
|
947
|
+
brightCyan: brighten("#8FBCBB", .15),
|
|
948
|
+
brightWhite: "#ECEFF4",
|
|
949
|
+
foreground: "#ECEFF4",
|
|
950
|
+
background: "#2E3440",
|
|
951
|
+
cursorColor: "#ECEFF4",
|
|
952
|
+
cursorText: "#2E3440",
|
|
953
|
+
selectionBackground: "#4C566A",
|
|
954
|
+
selectionForeground: "#ECEFF4"
|
|
955
|
+
};
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region packages/theme/src/schemes/dracula.ts
|
|
958
|
+
/** Dracula — vibrant dark theme. */
|
|
959
|
+
const dracula = {
|
|
960
|
+
name: "dracula",
|
|
961
|
+
dark: true,
|
|
962
|
+
black: "#21222C",
|
|
963
|
+
red: "#FF5555",
|
|
964
|
+
green: "#50FA7B",
|
|
965
|
+
yellow: "#F1FA8C",
|
|
966
|
+
blue: "#BD93F9",
|
|
967
|
+
magenta: "#BD93F9",
|
|
968
|
+
cyan: "#8BE9FD",
|
|
969
|
+
white: "#6272A4",
|
|
970
|
+
brightBlack: "#44475A",
|
|
971
|
+
brightRed: "#FFB86C",
|
|
972
|
+
brightGreen: brighten("#50FA7B", .15),
|
|
973
|
+
brightYellow: brighten("#F1FA8C", .15),
|
|
974
|
+
brightBlue: brighten("#BD93F9", .15),
|
|
975
|
+
brightMagenta: "#FF79C6",
|
|
976
|
+
brightCyan: brighten("#8BE9FD", .15),
|
|
977
|
+
brightWhite: "#F8F8F2",
|
|
978
|
+
foreground: "#F8F8F2",
|
|
979
|
+
background: "#282A36",
|
|
980
|
+
cursorColor: "#F8F8F2",
|
|
981
|
+
cursorText: "#282A36",
|
|
982
|
+
selectionBackground: "#6272A4",
|
|
983
|
+
selectionForeground: "#F8F8F2"
|
|
984
|
+
};
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region packages/theme/src/schemes/solarized.ts
|
|
987
|
+
/** Solarized Dark — Ethan Schoonover's classic dark variant. */
|
|
988
|
+
const solarizedDark = {
|
|
989
|
+
name: "solarized-dark",
|
|
990
|
+
dark: true,
|
|
991
|
+
black: "#002B36",
|
|
992
|
+
red: "#DC322F",
|
|
993
|
+
green: "#859900",
|
|
994
|
+
yellow: "#B58900",
|
|
995
|
+
blue: "#268BD2",
|
|
996
|
+
magenta: "#6C71C4",
|
|
997
|
+
cyan: "#2AA198",
|
|
998
|
+
white: "#839496",
|
|
999
|
+
brightBlack: "#586E75",
|
|
1000
|
+
brightRed: "#CB4B16",
|
|
1001
|
+
brightGreen: brighten("#859900", .15),
|
|
1002
|
+
brightYellow: brighten("#B58900", .15),
|
|
1003
|
+
brightBlue: brighten("#268BD2", .15),
|
|
1004
|
+
brightMagenta: "#D33682",
|
|
1005
|
+
brightCyan: brighten("#2AA198", .15),
|
|
1006
|
+
brightWhite: "#FDF6E3",
|
|
1007
|
+
foreground: "#FDF6E3",
|
|
1008
|
+
background: "#073642",
|
|
1009
|
+
cursorColor: "#FDF6E3",
|
|
1010
|
+
cursorText: "#073642",
|
|
1011
|
+
selectionBackground: "#657B83",
|
|
1012
|
+
selectionForeground: "#FDF6E3"
|
|
1013
|
+
};
|
|
1014
|
+
/** Solarized Light — Ethan Schoonover's classic light variant. */
|
|
1015
|
+
const solarizedLight = {
|
|
1016
|
+
name: "solarized-light",
|
|
1017
|
+
dark: false,
|
|
1018
|
+
black: "#FDF6E3",
|
|
1019
|
+
red: "#DC322F",
|
|
1020
|
+
green: "#859900",
|
|
1021
|
+
yellow: "#B58900",
|
|
1022
|
+
blue: "#268BD2",
|
|
1023
|
+
magenta: "#6C71C4",
|
|
1024
|
+
cyan: "#2AA198",
|
|
1025
|
+
white: "#657B83",
|
|
1026
|
+
brightBlack: "#DDD6C1",
|
|
1027
|
+
brightRed: "#CB4B16",
|
|
1028
|
+
brightGreen: brighten("#859900", .15),
|
|
1029
|
+
brightYellow: brighten("#B58900", .15),
|
|
1030
|
+
brightBlue: brighten("#268BD2", .15),
|
|
1031
|
+
brightMagenta: "#D33682",
|
|
1032
|
+
brightCyan: brighten("#2AA198", .15),
|
|
1033
|
+
brightWhite: "#073642",
|
|
1034
|
+
foreground: "#073642",
|
|
1035
|
+
background: "#EEE8D5",
|
|
1036
|
+
cursorColor: "#073642",
|
|
1037
|
+
cursorText: "#EEE8D5",
|
|
1038
|
+
selectionBackground: "#93A1A1",
|
|
1039
|
+
selectionForeground: "#073642"
|
|
1040
|
+
};
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region packages/theme/src/schemes/tokyo-night.ts
|
|
1043
|
+
/** Tokyo Night — the default dark variant. */
|
|
1044
|
+
const tokyoNight = {
|
|
1045
|
+
name: "tokyo-night",
|
|
1046
|
+
dark: true,
|
|
1047
|
+
black: "#1A1B26",
|
|
1048
|
+
red: "#F7768E",
|
|
1049
|
+
green: "#9ECE6A",
|
|
1050
|
+
yellow: "#E0AF68",
|
|
1051
|
+
blue: "#7AA2F7",
|
|
1052
|
+
magenta: "#BB9AF7",
|
|
1053
|
+
cyan: "#73DACA",
|
|
1054
|
+
white: "#A9B1D6",
|
|
1055
|
+
brightBlack: "#292E42",
|
|
1056
|
+
brightRed: "#FF9E64",
|
|
1057
|
+
brightGreen: brighten("#9ECE6A", .15),
|
|
1058
|
+
brightYellow: brighten("#E0AF68", .15),
|
|
1059
|
+
brightBlue: brighten("#7AA2F7", .15),
|
|
1060
|
+
brightMagenta: "#FF007C",
|
|
1061
|
+
brightCyan: brighten("#73DACA", .15),
|
|
1062
|
+
brightWhite: "#C0CAF5",
|
|
1063
|
+
foreground: "#C0CAF5",
|
|
1064
|
+
background: "#24283B",
|
|
1065
|
+
cursorColor: "#C0CAF5",
|
|
1066
|
+
cursorText: "#24283B",
|
|
1067
|
+
selectionBackground: "#545C7E",
|
|
1068
|
+
selectionForeground: "#C0CAF5"
|
|
1069
|
+
};
|
|
1070
|
+
/** Tokyo Night Storm — slightly lighter background. */
|
|
1071
|
+
const tokyoNightStorm = {
|
|
1072
|
+
name: "tokyo-night-storm",
|
|
1073
|
+
dark: true,
|
|
1074
|
+
black: "#1F2335",
|
|
1075
|
+
red: "#F7768E",
|
|
1076
|
+
green: "#9ECE6A",
|
|
1077
|
+
yellow: "#E0AF68",
|
|
1078
|
+
blue: "#7AA2F7",
|
|
1079
|
+
magenta: "#BB9AF7",
|
|
1080
|
+
cyan: "#73DACA",
|
|
1081
|
+
white: "#A9B1D6",
|
|
1082
|
+
brightBlack: "#292E42",
|
|
1083
|
+
brightRed: "#FF9E64",
|
|
1084
|
+
brightGreen: brighten("#9ECE6A", .15),
|
|
1085
|
+
brightYellow: brighten("#E0AF68", .15),
|
|
1086
|
+
brightBlue: brighten("#7AA2F7", .15),
|
|
1087
|
+
brightMagenta: "#FF007C",
|
|
1088
|
+
brightCyan: brighten("#73DACA", .15),
|
|
1089
|
+
brightWhite: "#C0CAF5",
|
|
1090
|
+
foreground: "#C0CAF5",
|
|
1091
|
+
background: "#24283B",
|
|
1092
|
+
cursorColor: "#C0CAF5",
|
|
1093
|
+
cursorText: "#24283B",
|
|
1094
|
+
selectionBackground: "#545C7E",
|
|
1095
|
+
selectionForeground: "#C0CAF5"
|
|
1096
|
+
};
|
|
1097
|
+
/** Tokyo Night Day — the light variant. */
|
|
1098
|
+
const tokyoNightDay = {
|
|
1099
|
+
name: "tokyo-night-day",
|
|
1100
|
+
dark: false,
|
|
1101
|
+
black: "#E1E2E7",
|
|
1102
|
+
red: "#F52A65",
|
|
1103
|
+
green: "#587539",
|
|
1104
|
+
yellow: "#8C6C3E",
|
|
1105
|
+
blue: "#2E7DE9",
|
|
1106
|
+
magenta: "#9854F1",
|
|
1107
|
+
cyan: "#118C74",
|
|
1108
|
+
white: "#6172B0",
|
|
1109
|
+
brightBlack: "#C4C5CB",
|
|
1110
|
+
brightRed: "#B15C00",
|
|
1111
|
+
brightGreen: brighten("#587539", .15),
|
|
1112
|
+
brightYellow: brighten("#8C6C3E", .15),
|
|
1113
|
+
brightBlue: brighten("#2E7DE9", .15),
|
|
1114
|
+
brightMagenta: "#F52A65",
|
|
1115
|
+
brightCyan: brighten("#118C74", .15),
|
|
1116
|
+
brightWhite: "#3760BF",
|
|
1117
|
+
foreground: "#3760BF",
|
|
1118
|
+
background: "#D5D6DB",
|
|
1119
|
+
cursorColor: "#3760BF",
|
|
1120
|
+
cursorText: "#D5D6DB",
|
|
1121
|
+
selectionBackground: "#9699A3",
|
|
1122
|
+
selectionForeground: "#3760BF"
|
|
1123
|
+
};
|
|
1124
|
+
//#endregion
|
|
1125
|
+
//#region packages/theme/src/schemes/one-dark.ts
|
|
1126
|
+
/** One Dark — the classic Atom editor theme. */
|
|
1127
|
+
const oneDark = {
|
|
1128
|
+
name: "one-dark",
|
|
1129
|
+
dark: true,
|
|
1130
|
+
black: "#21252B",
|
|
1131
|
+
red: "#E06C75",
|
|
1132
|
+
green: "#98C379",
|
|
1133
|
+
yellow: "#E5C07B",
|
|
1134
|
+
blue: "#61AFEF",
|
|
1135
|
+
magenta: "#C678DD",
|
|
1136
|
+
cyan: "#56B6C2",
|
|
1137
|
+
white: "#ABB2BF",
|
|
1138
|
+
brightBlack: "#2C313A",
|
|
1139
|
+
brightRed: "#D19A66",
|
|
1140
|
+
brightGreen: brighten("#98C379", .15),
|
|
1141
|
+
brightYellow: brighten("#E5C07B", .15),
|
|
1142
|
+
brightBlue: brighten("#61AFEF", .15),
|
|
1143
|
+
brightMagenta: "#E06C75",
|
|
1144
|
+
brightCyan: brighten("#56B6C2", .15),
|
|
1145
|
+
brightWhite: "#ABB2BF",
|
|
1146
|
+
foreground: "#ABB2BF",
|
|
1147
|
+
background: "#282C34",
|
|
1148
|
+
cursorColor: "#ABB2BF",
|
|
1149
|
+
cursorText: "#282C34",
|
|
1150
|
+
selectionBackground: "#5C6370",
|
|
1151
|
+
selectionForeground: "#ABB2BF"
|
|
1152
|
+
};
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region packages/theme/src/schemes/gruvbox.ts
|
|
1155
|
+
/** Gruvbox Dark — warm retro dark theme. */
|
|
1156
|
+
const gruvboxDark = {
|
|
1157
|
+
name: "gruvbox-dark",
|
|
1158
|
+
dark: true,
|
|
1159
|
+
black: "#1D2021",
|
|
1160
|
+
red: "#FB4934",
|
|
1161
|
+
green: "#B8BB26",
|
|
1162
|
+
yellow: "#FABD2F",
|
|
1163
|
+
blue: "#83A598",
|
|
1164
|
+
magenta: "#D3869B",
|
|
1165
|
+
cyan: "#8EC07C",
|
|
1166
|
+
white: "#BDAE93",
|
|
1167
|
+
brightBlack: "#3C3836",
|
|
1168
|
+
brightRed: "#FE8019",
|
|
1169
|
+
brightGreen: brighten("#B8BB26", .15),
|
|
1170
|
+
brightYellow: brighten("#FABD2F", .15),
|
|
1171
|
+
brightBlue: brighten("#83A598", .15),
|
|
1172
|
+
brightMagenta: "#D3869B",
|
|
1173
|
+
brightCyan: brighten("#8EC07C", .15),
|
|
1174
|
+
brightWhite: "#EBDBB2",
|
|
1175
|
+
foreground: "#EBDBB2",
|
|
1176
|
+
background: "#282828",
|
|
1177
|
+
cursorColor: "#EBDBB2",
|
|
1178
|
+
cursorText: "#282828",
|
|
1179
|
+
selectionBackground: "#665C54",
|
|
1180
|
+
selectionForeground: "#EBDBB2"
|
|
1181
|
+
};
|
|
1182
|
+
/** Gruvbox Light — warm retro light theme. */
|
|
1183
|
+
const gruvboxLight = {
|
|
1184
|
+
name: "gruvbox-light",
|
|
1185
|
+
dark: false,
|
|
1186
|
+
black: "#F9F5D7",
|
|
1187
|
+
red: "#CC241D",
|
|
1188
|
+
green: "#98971A",
|
|
1189
|
+
yellow: "#D79921",
|
|
1190
|
+
blue: "#458588",
|
|
1191
|
+
magenta: "#B16286",
|
|
1192
|
+
cyan: "#689D6A",
|
|
1193
|
+
white: "#665C54",
|
|
1194
|
+
brightBlack: "#EBDBB2",
|
|
1195
|
+
brightRed: "#D65D0E",
|
|
1196
|
+
brightGreen: brighten("#98971A", .15),
|
|
1197
|
+
brightYellow: brighten("#D79921", .15),
|
|
1198
|
+
brightBlue: brighten("#458588", .15),
|
|
1199
|
+
brightMagenta: "#B16286",
|
|
1200
|
+
brightCyan: brighten("#689D6A", .15),
|
|
1201
|
+
brightWhite: "#3C3836",
|
|
1202
|
+
foreground: "#3C3836",
|
|
1203
|
+
background: "#FBF1C7",
|
|
1204
|
+
cursorColor: "#3C3836",
|
|
1205
|
+
cursorText: "#FBF1C7",
|
|
1206
|
+
selectionBackground: "#A89984",
|
|
1207
|
+
selectionForeground: "#3C3836"
|
|
1208
|
+
};
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region packages/theme/src/schemes/rose-pine.ts
|
|
1211
|
+
/** Rosé Pine — the main dark variant. */
|
|
1212
|
+
const rosePine = {
|
|
1213
|
+
name: "rose-pine",
|
|
1214
|
+
dark: true,
|
|
1215
|
+
black: "#191724",
|
|
1216
|
+
red: "#EB6F92",
|
|
1217
|
+
green: "#31748F",
|
|
1218
|
+
yellow: "#F6C177",
|
|
1219
|
+
blue: "#3E8FB0",
|
|
1220
|
+
magenta: "#C4A7E7",
|
|
1221
|
+
cyan: "#9CCFD8",
|
|
1222
|
+
white: "#908CAA",
|
|
1223
|
+
brightBlack: "#26233A",
|
|
1224
|
+
brightRed: "#EA9A97",
|
|
1225
|
+
brightGreen: brighten("#31748F", .15),
|
|
1226
|
+
brightYellow: brighten("#F6C177", .15),
|
|
1227
|
+
brightBlue: brighten("#3E8FB0", .15),
|
|
1228
|
+
brightMagenta: "#EBBCBA",
|
|
1229
|
+
brightCyan: brighten("#9CCFD8", .15),
|
|
1230
|
+
brightWhite: "#E0DEF4",
|
|
1231
|
+
foreground: "#E0DEF4",
|
|
1232
|
+
background: "#1F1D2E",
|
|
1233
|
+
cursorColor: "#E0DEF4",
|
|
1234
|
+
cursorText: "#1F1D2E",
|
|
1235
|
+
selectionBackground: "#6E6A86",
|
|
1236
|
+
selectionForeground: "#E0DEF4"
|
|
1237
|
+
};
|
|
1238
|
+
/** Rosé Pine Moon — slightly lighter dark variant. */
|
|
1239
|
+
const rosePineMoon = {
|
|
1240
|
+
name: "rose-pine-moon",
|
|
1241
|
+
dark: true,
|
|
1242
|
+
black: "#232136",
|
|
1243
|
+
red: "#EB6F92",
|
|
1244
|
+
green: "#3E8FB0",
|
|
1245
|
+
yellow: "#F6C177",
|
|
1246
|
+
blue: "#3E8FB0",
|
|
1247
|
+
magenta: "#C4A7E7",
|
|
1248
|
+
cyan: "#9CCFD8",
|
|
1249
|
+
white: "#908CAA",
|
|
1250
|
+
brightBlack: "#393552",
|
|
1251
|
+
brightRed: "#EA9A97",
|
|
1252
|
+
brightGreen: brighten("#3E8FB0", .15),
|
|
1253
|
+
brightYellow: brighten("#F6C177", .15),
|
|
1254
|
+
brightBlue: brighten("#3E8FB0", .15),
|
|
1255
|
+
brightMagenta: "#EA9A97",
|
|
1256
|
+
brightCyan: brighten("#9CCFD8", .15),
|
|
1257
|
+
brightWhite: "#E0DEF4",
|
|
1258
|
+
foreground: "#E0DEF4",
|
|
1259
|
+
background: "#2A273F",
|
|
1260
|
+
cursorColor: "#E0DEF4",
|
|
1261
|
+
cursorText: "#2A273F",
|
|
1262
|
+
selectionBackground: "#6E6A86",
|
|
1263
|
+
selectionForeground: "#E0DEF4"
|
|
1264
|
+
};
|
|
1265
|
+
/** Rosé Pine Dawn — the light variant. */
|
|
1266
|
+
const rosePineDawn = {
|
|
1267
|
+
name: "rose-pine-dawn",
|
|
1268
|
+
dark: false,
|
|
1269
|
+
black: "#FAF4ED",
|
|
1270
|
+
red: "#B4637A",
|
|
1271
|
+
green: "#286983",
|
|
1272
|
+
yellow: "#EA9D34",
|
|
1273
|
+
blue: "#286983",
|
|
1274
|
+
magenta: "#907AA9",
|
|
1275
|
+
cyan: "#56949F",
|
|
1276
|
+
white: "#797593",
|
|
1277
|
+
brightBlack: "#F2E9E1",
|
|
1278
|
+
brightRed: "#D7827E",
|
|
1279
|
+
brightGreen: brighten("#286983", .15),
|
|
1280
|
+
brightYellow: brighten("#EA9D34", .15),
|
|
1281
|
+
brightBlue: brighten("#286983", .15),
|
|
1282
|
+
brightMagenta: "#D7827E",
|
|
1283
|
+
brightCyan: brighten("#56949F", .15),
|
|
1284
|
+
brightWhite: "#575279",
|
|
1285
|
+
foreground: "#575279",
|
|
1286
|
+
background: "#FFFAF3",
|
|
1287
|
+
cursorColor: "#575279",
|
|
1288
|
+
cursorText: "#FFFAF3",
|
|
1289
|
+
selectionBackground: "#9893A5",
|
|
1290
|
+
selectionForeground: "#575279"
|
|
1291
|
+
};
|
|
1292
|
+
//#endregion
|
|
1293
|
+
//#region packages/theme/src/schemes/kanagawa.ts
|
|
1294
|
+
/** Kanagawa Wave — the default dark variant, inspired by "The Great Wave off Kanagawa". */
|
|
1295
|
+
const kanagawaWave = {
|
|
1296
|
+
name: "kanagawa-wave",
|
|
1297
|
+
dark: true,
|
|
1298
|
+
black: "#16161D",
|
|
1299
|
+
red: "#C34043",
|
|
1300
|
+
green: "#98BB6C",
|
|
1301
|
+
yellow: "#E6C384",
|
|
1302
|
+
blue: "#7E9CD8",
|
|
1303
|
+
magenta: "#957FB8",
|
|
1304
|
+
cyan: "#6A9589",
|
|
1305
|
+
white: "#727169",
|
|
1306
|
+
brightBlack: "#2A2A37",
|
|
1307
|
+
brightRed: "#FFA066",
|
|
1308
|
+
brightGreen: brighten("#98BB6C", .15),
|
|
1309
|
+
brightYellow: brighten("#E6C384", .15),
|
|
1310
|
+
brightBlue: brighten("#7E9CD8", .15),
|
|
1311
|
+
brightMagenta: "#D27E99",
|
|
1312
|
+
brightCyan: brighten("#6A9589", .15),
|
|
1313
|
+
brightWhite: "#DCD7BA",
|
|
1314
|
+
foreground: "#DCD7BA",
|
|
1315
|
+
background: "#1F1F28",
|
|
1316
|
+
cursorColor: "#DCD7BA",
|
|
1317
|
+
cursorText: "#1F1F28",
|
|
1318
|
+
selectionBackground: "#54546D",
|
|
1319
|
+
selectionForeground: "#DCD7BA"
|
|
1320
|
+
};
|
|
1321
|
+
/** Kanagawa Dragon — a muted, earthy dark variant. */
|
|
1322
|
+
const kanagawaDragon = {
|
|
1323
|
+
name: "kanagawa-dragon",
|
|
1324
|
+
dark: true,
|
|
1325
|
+
black: "#0d0c0c",
|
|
1326
|
+
red: "#c4746e",
|
|
1327
|
+
green: "#87a987",
|
|
1328
|
+
yellow: "#c4b28a",
|
|
1329
|
+
blue: "#8ba4b0",
|
|
1330
|
+
magenta: "#8992a7",
|
|
1331
|
+
cyan: "#8ea4a2",
|
|
1332
|
+
white: "#737c73",
|
|
1333
|
+
brightBlack: "#282727",
|
|
1334
|
+
brightRed: "#b6927b",
|
|
1335
|
+
brightGreen: brighten("#87a987", .15),
|
|
1336
|
+
brightYellow: brighten("#c4b28a", .15),
|
|
1337
|
+
brightBlue: brighten("#8ba4b0", .15),
|
|
1338
|
+
brightMagenta: "#a292a3",
|
|
1339
|
+
brightCyan: brighten("#8ea4a2", .15),
|
|
1340
|
+
brightWhite: "#c5c9c5",
|
|
1341
|
+
foreground: "#c5c9c5",
|
|
1342
|
+
background: "#181616",
|
|
1343
|
+
cursorColor: "#c5c9c5",
|
|
1344
|
+
cursorText: "#181616",
|
|
1345
|
+
selectionBackground: "#625e5a",
|
|
1346
|
+
selectionForeground: "#c5c9c5"
|
|
1347
|
+
};
|
|
1348
|
+
/** Kanagawa Lotus — the light variant, inspired by lotus flowers. */
|
|
1349
|
+
const kanagawaLotus = {
|
|
1350
|
+
name: "kanagawa-lotus",
|
|
1351
|
+
dark: false,
|
|
1352
|
+
black: "#e5ddb0",
|
|
1353
|
+
red: "#c84053",
|
|
1354
|
+
green: "#6f894e",
|
|
1355
|
+
yellow: "#de9800",
|
|
1356
|
+
blue: "#4d699b",
|
|
1357
|
+
magenta: "#624c83",
|
|
1358
|
+
cyan: "#597b75",
|
|
1359
|
+
white: "#716e61",
|
|
1360
|
+
brightBlack: "#dcd5ac",
|
|
1361
|
+
brightRed: "#cc6d00",
|
|
1362
|
+
brightGreen: brighten("#6f894e", .15),
|
|
1363
|
+
brightYellow: brighten("#de9800", .15),
|
|
1364
|
+
brightBlue: brighten("#4d699b", .15),
|
|
1365
|
+
brightMagenta: "#b35b79",
|
|
1366
|
+
brightCyan: brighten("#597b75", .15),
|
|
1367
|
+
brightWhite: "#545464",
|
|
1368
|
+
foreground: "#545464",
|
|
1369
|
+
background: "#f2ecbc",
|
|
1370
|
+
cursorColor: "#545464",
|
|
1371
|
+
cursorText: "#f2ecbc",
|
|
1372
|
+
selectionBackground: "#8a8980",
|
|
1373
|
+
selectionForeground: "#545464"
|
|
1374
|
+
};
|
|
1375
|
+
//#endregion
|
|
1376
|
+
//#region packages/theme/src/schemes/everforest.ts
|
|
1377
|
+
/** Everforest Dark — warm green-based dark theme (medium background). */
|
|
1378
|
+
const everforestDark = {
|
|
1379
|
+
name: "everforest-dark",
|
|
1380
|
+
dark: true,
|
|
1381
|
+
black: "#232a2e",
|
|
1382
|
+
red: "#e67e80",
|
|
1383
|
+
green: "#a7c080",
|
|
1384
|
+
yellow: "#dbbc7f",
|
|
1385
|
+
blue: "#7fbbb3",
|
|
1386
|
+
magenta: "#d699b6",
|
|
1387
|
+
cyan: "#83c092",
|
|
1388
|
+
white: "#859289",
|
|
1389
|
+
brightBlack: "#343f44",
|
|
1390
|
+
brightRed: "#e69875",
|
|
1391
|
+
brightGreen: brighten("#a7c080", .15),
|
|
1392
|
+
brightYellow: brighten("#dbbc7f", .15),
|
|
1393
|
+
brightBlue: brighten("#7fbbb3", .15),
|
|
1394
|
+
brightMagenta: "#e67e80",
|
|
1395
|
+
brightCyan: brighten("#83c092", .15),
|
|
1396
|
+
brightWhite: "#d3c6aa",
|
|
1397
|
+
foreground: "#d3c6aa",
|
|
1398
|
+
background: "#2d353b",
|
|
1399
|
+
cursorColor: "#d3c6aa",
|
|
1400
|
+
cursorText: "#2d353b",
|
|
1401
|
+
selectionBackground: "#4f585e",
|
|
1402
|
+
selectionForeground: "#d3c6aa"
|
|
1403
|
+
};
|
|
1404
|
+
/** Everforest Light — warm green-based light theme (medium background). */
|
|
1405
|
+
const everforestLight = {
|
|
1406
|
+
name: "everforest-light",
|
|
1407
|
+
dark: false,
|
|
1408
|
+
black: "#efebd4",
|
|
1409
|
+
red: "#f85552",
|
|
1410
|
+
green: "#8da101",
|
|
1411
|
+
yellow: "#dfa000",
|
|
1412
|
+
blue: "#3a94c5",
|
|
1413
|
+
magenta: "#df69ba",
|
|
1414
|
+
cyan: "#35a77c",
|
|
1415
|
+
white: "#939f91",
|
|
1416
|
+
brightBlack: "#f4f0d9",
|
|
1417
|
+
brightRed: "#f57d26",
|
|
1418
|
+
brightGreen: brighten("#8da101", .15),
|
|
1419
|
+
brightYellow: brighten("#dfa000", .15),
|
|
1420
|
+
brightBlue: brighten("#3a94c5", .15),
|
|
1421
|
+
brightMagenta: "#f85552",
|
|
1422
|
+
brightCyan: brighten("#35a77c", .15),
|
|
1423
|
+
brightWhite: "#5c6a72",
|
|
1424
|
+
foreground: "#5c6a72",
|
|
1425
|
+
background: "#fdf6e3",
|
|
1426
|
+
cursorColor: "#5c6a72",
|
|
1427
|
+
cursorText: "#fdf6e3",
|
|
1428
|
+
selectionBackground: "#e0dcc7",
|
|
1429
|
+
selectionForeground: "#5c6a72"
|
|
1430
|
+
};
|
|
1431
|
+
//#endregion
|
|
1432
|
+
//#region packages/theme/src/schemes/monokai.ts
|
|
1433
|
+
/** Monokai Classic — the original Sublime Text Monokai colors. */
|
|
1434
|
+
const monokai = {
|
|
1435
|
+
name: "monokai",
|
|
1436
|
+
dark: true,
|
|
1437
|
+
black: "#1a1a1a",
|
|
1438
|
+
red: "#F92672",
|
|
1439
|
+
green: "#A6E22E",
|
|
1440
|
+
yellow: "#E6DB74",
|
|
1441
|
+
blue: "#66D9EF",
|
|
1442
|
+
magenta: "#AE81FF",
|
|
1443
|
+
cyan: "#66D9EF",
|
|
1444
|
+
white: "#a59f85",
|
|
1445
|
+
brightBlack: "#3e3d32",
|
|
1446
|
+
brightRed: "#FD971F",
|
|
1447
|
+
brightGreen: brighten("#A6E22E", .15),
|
|
1448
|
+
brightYellow: brighten("#E6DB74", .15),
|
|
1449
|
+
brightBlue: brighten("#66D9EF", .15),
|
|
1450
|
+
brightMagenta: "#F92672",
|
|
1451
|
+
brightCyan: brighten("#66D9EF", .15),
|
|
1452
|
+
brightWhite: "#F8F8F2",
|
|
1453
|
+
foreground: "#F8F8F2",
|
|
1454
|
+
background: "#272822",
|
|
1455
|
+
cursorColor: "#F8F8F2",
|
|
1456
|
+
cursorText: "#272822",
|
|
1457
|
+
selectionBackground: "#75715E",
|
|
1458
|
+
selectionForeground: "#F8F8F2"
|
|
1459
|
+
};
|
|
1460
|
+
/** Monokai Pro — the modern, refined Monokai with balanced colors. */
|
|
1461
|
+
const monokaiPro = {
|
|
1462
|
+
name: "monokai-pro",
|
|
1463
|
+
dark: true,
|
|
1464
|
+
black: "#221f22",
|
|
1465
|
+
red: "#ff6188",
|
|
1466
|
+
green: "#a9dc76",
|
|
1467
|
+
yellow: "#ffd866",
|
|
1468
|
+
blue: "#78dce8",
|
|
1469
|
+
magenta: "#ab9df2",
|
|
1470
|
+
cyan: "#78dce8",
|
|
1471
|
+
white: "#939293",
|
|
1472
|
+
brightBlack: "#403e41",
|
|
1473
|
+
brightRed: "#fc9867",
|
|
1474
|
+
brightGreen: brighten("#a9dc76", .15),
|
|
1475
|
+
brightYellow: brighten("#ffd866", .15),
|
|
1476
|
+
brightBlue: brighten("#78dce8", .15),
|
|
1477
|
+
brightMagenta: "#ff6188",
|
|
1478
|
+
brightCyan: brighten("#78dce8", .15),
|
|
1479
|
+
brightWhite: "#fcfcfa",
|
|
1480
|
+
foreground: "#fcfcfa",
|
|
1481
|
+
background: "#2d2a2e",
|
|
1482
|
+
cursorColor: "#fcfcfa",
|
|
1483
|
+
cursorText: "#2d2a2e",
|
|
1484
|
+
selectionBackground: "#727072",
|
|
1485
|
+
selectionForeground: "#fcfcfa"
|
|
1486
|
+
};
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region packages/theme/src/schemes/snazzy.ts
|
|
1489
|
+
/** Snazzy — clean dark theme by Sindre Sorhus. */
|
|
1490
|
+
const snazzy = {
|
|
1491
|
+
name: "snazzy",
|
|
1492
|
+
dark: true,
|
|
1493
|
+
black: "#222430",
|
|
1494
|
+
red: "#ff5c57",
|
|
1495
|
+
green: "#5af78e",
|
|
1496
|
+
yellow: "#f3f99d",
|
|
1497
|
+
blue: "#57c7ff",
|
|
1498
|
+
magenta: "#b267e6",
|
|
1499
|
+
cyan: "#9aedfe",
|
|
1500
|
+
white: "#97979b",
|
|
1501
|
+
brightBlack: "#34353e",
|
|
1502
|
+
brightRed: "#ff9f43",
|
|
1503
|
+
brightGreen: brighten("#5af78e", .15),
|
|
1504
|
+
brightYellow: brighten("#f3f99d", .15),
|
|
1505
|
+
brightBlue: brighten("#57c7ff", .15),
|
|
1506
|
+
brightMagenta: "#ff6ac1",
|
|
1507
|
+
brightCyan: brighten("#9aedfe", .15),
|
|
1508
|
+
brightWhite: "#eff0eb",
|
|
1509
|
+
foreground: "#eff0eb",
|
|
1510
|
+
background: "#282a36",
|
|
1511
|
+
cursorColor: "#eff0eb",
|
|
1512
|
+
cursorText: "#282a36",
|
|
1513
|
+
selectionBackground: "#686868",
|
|
1514
|
+
selectionForeground: "#eff0eb"
|
|
1515
|
+
};
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region packages/theme/src/schemes/material.ts
|
|
1518
|
+
/** Material Darker — the deep dark Material variant. */
|
|
1519
|
+
const materialDark = {
|
|
1520
|
+
name: "material-dark",
|
|
1521
|
+
dark: true,
|
|
1522
|
+
black: "#171717",
|
|
1523
|
+
red: "#ff5370",
|
|
1524
|
+
green: "#c3e88d",
|
|
1525
|
+
yellow: "#ffcb6b",
|
|
1526
|
+
blue: "#82aaff",
|
|
1527
|
+
magenta: "#c792ea",
|
|
1528
|
+
cyan: "#89ddff",
|
|
1529
|
+
white: "#545454",
|
|
1530
|
+
brightBlack: "#2c2c2c",
|
|
1531
|
+
brightRed: "#f78c6c",
|
|
1532
|
+
brightGreen: brighten("#c3e88d", .15),
|
|
1533
|
+
brightYellow: brighten("#ffcb6b", .15),
|
|
1534
|
+
brightBlue: brighten("#82aaff", .15),
|
|
1535
|
+
brightMagenta: "#f07178",
|
|
1536
|
+
brightCyan: brighten("#89ddff", .15),
|
|
1537
|
+
brightWhite: "#eeffff",
|
|
1538
|
+
foreground: "#eeffff",
|
|
1539
|
+
background: "#212121",
|
|
1540
|
+
cursorColor: "#eeffff",
|
|
1541
|
+
cursorText: "#212121",
|
|
1542
|
+
selectionBackground: "#424242",
|
|
1543
|
+
selectionForeground: "#eeffff"
|
|
1544
|
+
};
|
|
1545
|
+
/** Material Lighter — the light Material variant. */
|
|
1546
|
+
const materialLight = {
|
|
1547
|
+
name: "material-light",
|
|
1548
|
+
dark: false,
|
|
1549
|
+
black: "#ecf0f1",
|
|
1550
|
+
red: "#e53935",
|
|
1551
|
+
green: "#91b859",
|
|
1552
|
+
yellow: "#ffb62c",
|
|
1553
|
+
blue: "#6182b8",
|
|
1554
|
+
magenta: "#7c4dff",
|
|
1555
|
+
cyan: "#39adb5",
|
|
1556
|
+
white: "#90a4ae",
|
|
1557
|
+
brightBlack: "#ebf4f3",
|
|
1558
|
+
brightRed: "#f76d47",
|
|
1559
|
+
brightGreen: brighten("#91b859", .15),
|
|
1560
|
+
brightYellow: brighten("#ffb62c", .15),
|
|
1561
|
+
brightBlue: brighten("#6182b8", .15),
|
|
1562
|
+
brightMagenta: "#ff5370",
|
|
1563
|
+
brightCyan: brighten("#39adb5", .15),
|
|
1564
|
+
brightWhite: "#546E7A",
|
|
1565
|
+
foreground: "#546E7A",
|
|
1566
|
+
background: "#fafafa",
|
|
1567
|
+
cursorColor: "#546E7A",
|
|
1568
|
+
cursorText: "#fafafa",
|
|
1569
|
+
selectionBackground: "#cfd8dc",
|
|
1570
|
+
selectionForeground: "#546E7A"
|
|
1571
|
+
};
|
|
1572
|
+
//#endregion
|
|
1573
|
+
//#region packages/theme/src/schemes/palenight.ts
|
|
1574
|
+
/** Palenight — the soft, purple-tinted Material dark variant. */
|
|
1575
|
+
const palenight = {
|
|
1576
|
+
name: "palenight",
|
|
1577
|
+
dark: true,
|
|
1578
|
+
black: "#1c1f2b",
|
|
1579
|
+
red: "#f07178",
|
|
1580
|
+
green: "#c3e88d",
|
|
1581
|
+
yellow: "#ffcb6b",
|
|
1582
|
+
blue: "#82aaff",
|
|
1583
|
+
magenta: "#c792ea",
|
|
1584
|
+
cyan: "#89ddff",
|
|
1585
|
+
white: "#676e95",
|
|
1586
|
+
brightBlack: "#343b51",
|
|
1587
|
+
brightRed: "#f78c6c",
|
|
1588
|
+
brightGreen: brighten("#c3e88d", .15),
|
|
1589
|
+
brightYellow: brighten("#ffcb6b", .15),
|
|
1590
|
+
brightBlue: brighten("#82aaff", .15),
|
|
1591
|
+
brightMagenta: "#ff5370",
|
|
1592
|
+
brightCyan: brighten("#89ddff", .15),
|
|
1593
|
+
brightWhite: "#a6accd",
|
|
1594
|
+
foreground: "#a6accd",
|
|
1595
|
+
background: "#292d3e",
|
|
1596
|
+
cursorColor: "#a6accd",
|
|
1597
|
+
cursorText: "#292d3e",
|
|
1598
|
+
selectionBackground: "#4e5579",
|
|
1599
|
+
selectionForeground: "#a6accd"
|
|
1600
|
+
};
|
|
1601
|
+
//#endregion
|
|
1602
|
+
//#region packages/theme/src/schemes/ayu.ts
|
|
1603
|
+
/** Ayu Dark — deep dark variant with warm accents. */
|
|
1604
|
+
const ayuDark = {
|
|
1605
|
+
name: "ayu-dark",
|
|
1606
|
+
dark: true,
|
|
1607
|
+
black: "#05070A",
|
|
1608
|
+
red: "#D95757",
|
|
1609
|
+
green: "#AAD94C",
|
|
1610
|
+
yellow: "#E6B450",
|
|
1611
|
+
blue: "#59C2FF",
|
|
1612
|
+
magenta: "#D2A6FF",
|
|
1613
|
+
cyan: "#95E6CB",
|
|
1614
|
+
white: "#636A72",
|
|
1615
|
+
brightBlack: "#11151C",
|
|
1616
|
+
brightRed: "#F29668",
|
|
1617
|
+
brightGreen: brighten("#AAD94C", .15),
|
|
1618
|
+
brightYellow: brighten("#E6B450", .15),
|
|
1619
|
+
brightBlue: brighten("#59C2FF", .15),
|
|
1620
|
+
brightMagenta: "#F07178",
|
|
1621
|
+
brightCyan: brighten("#95E6CB", .15),
|
|
1622
|
+
brightWhite: "#BFBDB6",
|
|
1623
|
+
foreground: "#BFBDB6",
|
|
1624
|
+
background: "#0B0E14",
|
|
1625
|
+
cursorColor: "#BFBDB6",
|
|
1626
|
+
cursorText: "#0B0E14",
|
|
1627
|
+
selectionBackground: "#565B66",
|
|
1628
|
+
selectionForeground: "#BFBDB6"
|
|
1629
|
+
};
|
|
1630
|
+
/** Ayu Mirage — balanced dark variant with softer contrast. */
|
|
1631
|
+
const ayuMirage = {
|
|
1632
|
+
name: "ayu-mirage",
|
|
1633
|
+
dark: true,
|
|
1634
|
+
black: "#101521",
|
|
1635
|
+
red: "#FF6666",
|
|
1636
|
+
green: "#D5FF80",
|
|
1637
|
+
yellow: "#FFCC66",
|
|
1638
|
+
blue: "#73D0FF",
|
|
1639
|
+
magenta: "#DFBFFF",
|
|
1640
|
+
cyan: "#95E6CB",
|
|
1641
|
+
white: "#6C7A8B",
|
|
1642
|
+
brightBlack: "#171B24",
|
|
1643
|
+
brightRed: "#F29E74",
|
|
1644
|
+
brightGreen: brighten("#D5FF80", .15),
|
|
1645
|
+
brightYellow: brighten("#FFCC66", .15),
|
|
1646
|
+
brightBlue: brighten("#73D0FF", .15),
|
|
1647
|
+
brightMagenta: "#F28779",
|
|
1648
|
+
brightCyan: brighten("#95E6CB", .15),
|
|
1649
|
+
brightWhite: "#CCCAC2",
|
|
1650
|
+
foreground: "#CCCAC2",
|
|
1651
|
+
background: "#1F2430",
|
|
1652
|
+
cursorColor: "#CCCAC2",
|
|
1653
|
+
cursorText: "#1F2430",
|
|
1654
|
+
selectionBackground: "#707A8C",
|
|
1655
|
+
selectionForeground: "#CCCAC2"
|
|
1656
|
+
};
|
|
1657
|
+
/** Ayu Light — clean light variant. */
|
|
1658
|
+
const ayuLight = {
|
|
1659
|
+
name: "ayu-light",
|
|
1660
|
+
dark: false,
|
|
1661
|
+
black: "#E7EAED",
|
|
1662
|
+
red: "#E65050",
|
|
1663
|
+
green: "#86B300",
|
|
1664
|
+
yellow: "#FFAA33",
|
|
1665
|
+
blue: "#399EE6",
|
|
1666
|
+
magenta: "#A37ACC",
|
|
1667
|
+
cyan: "#4CBF99",
|
|
1668
|
+
white: "#ABADB1",
|
|
1669
|
+
brightBlack: "#F3F4F5",
|
|
1670
|
+
brightRed: "#ED9366",
|
|
1671
|
+
brightGreen: brighten("#86B300", .15),
|
|
1672
|
+
brightYellow: brighten("#FFAA33", .15),
|
|
1673
|
+
brightBlue: brighten("#399EE6", .15),
|
|
1674
|
+
brightMagenta: "#F07171",
|
|
1675
|
+
brightCyan: brighten("#4CBF99", .15),
|
|
1676
|
+
brightWhite: "#5C6166",
|
|
1677
|
+
foreground: "#5C6166",
|
|
1678
|
+
background: "#F8F9FA",
|
|
1679
|
+
cursorColor: "#5C6166",
|
|
1680
|
+
cursorText: "#F8F9FA",
|
|
1681
|
+
selectionBackground: "#8A9199",
|
|
1682
|
+
selectionForeground: "#5C6166"
|
|
1683
|
+
};
|
|
1684
|
+
//#endregion
|
|
1685
|
+
//#region packages/theme/src/schemes/nightfox.ts
|
|
1686
|
+
/** Nightfox — dark blue-toned variant. */
|
|
1687
|
+
const nightfox = {
|
|
1688
|
+
name: "nightfox",
|
|
1689
|
+
dark: true,
|
|
1690
|
+
black: "#131A24",
|
|
1691
|
+
red: "#C94F6D",
|
|
1692
|
+
green: "#81B29A",
|
|
1693
|
+
yellow: "#DBC074",
|
|
1694
|
+
blue: "#719CD6",
|
|
1695
|
+
magenta: "#9D79D6",
|
|
1696
|
+
cyan: "#63CDCF",
|
|
1697
|
+
white: "#71839B",
|
|
1698
|
+
brightBlack: "#212E3F",
|
|
1699
|
+
brightRed: "#F4A261",
|
|
1700
|
+
brightGreen: brighten("#81B29A", .15),
|
|
1701
|
+
brightYellow: brighten("#DBC074", .15),
|
|
1702
|
+
brightBlue: brighten("#719CD6", .15),
|
|
1703
|
+
brightMagenta: "#D67AD2",
|
|
1704
|
+
brightCyan: brighten("#63CDCF", .15),
|
|
1705
|
+
brightWhite: "#CDCECF",
|
|
1706
|
+
foreground: "#CDCECF",
|
|
1707
|
+
background: "#192330",
|
|
1708
|
+
cursorColor: "#CDCECF",
|
|
1709
|
+
cursorText: "#192330",
|
|
1710
|
+
selectionBackground: "#39506D",
|
|
1711
|
+
selectionForeground: "#CDCECF"
|
|
1712
|
+
};
|
|
1713
|
+
/** Dawnfox — warm light variant inspired by Rose Pine Dawn. */
|
|
1714
|
+
const dawnfox = {
|
|
1715
|
+
name: "dawnfox",
|
|
1716
|
+
dark: false,
|
|
1717
|
+
black: "#EBE5DF",
|
|
1718
|
+
red: "#B4637A",
|
|
1719
|
+
green: "#618774",
|
|
1720
|
+
yellow: "#EA9D34",
|
|
1721
|
+
blue: "#286983",
|
|
1722
|
+
magenta: "#907AA9",
|
|
1723
|
+
cyan: "#56949F",
|
|
1724
|
+
white: "#A8A3B3",
|
|
1725
|
+
brightBlack: "#EBE0DF",
|
|
1726
|
+
brightRed: "#D7827E",
|
|
1727
|
+
brightGreen: brighten("#618774", .15),
|
|
1728
|
+
brightYellow: brighten("#EA9D34", .15),
|
|
1729
|
+
brightBlue: brighten("#286983", .15),
|
|
1730
|
+
brightMagenta: "#D685AF",
|
|
1731
|
+
brightCyan: brighten("#56949F", .15),
|
|
1732
|
+
brightWhite: "#575279",
|
|
1733
|
+
foreground: "#575279",
|
|
1734
|
+
background: "#FAF4ED",
|
|
1735
|
+
cursorColor: "#575279",
|
|
1736
|
+
cursorText: "#FAF4ED",
|
|
1737
|
+
selectionBackground: "#BDBFC9",
|
|
1738
|
+
selectionForeground: "#575279"
|
|
1739
|
+
};
|
|
1740
|
+
//#endregion
|
|
1741
|
+
//#region packages/theme/src/schemes/horizon.ts
|
|
1742
|
+
/** Horizon — warm dark variant with vivid accents. */
|
|
1743
|
+
const horizon = {
|
|
1744
|
+
name: "horizon",
|
|
1745
|
+
dark: true,
|
|
1746
|
+
black: "#16161C",
|
|
1747
|
+
red: "#E95678",
|
|
1748
|
+
green: "#29D398",
|
|
1749
|
+
yellow: "#FAC29A",
|
|
1750
|
+
blue: "#26BBD9",
|
|
1751
|
+
magenta: "#B877DB",
|
|
1752
|
+
cyan: "#59E1E3",
|
|
1753
|
+
white: "#6C6F93",
|
|
1754
|
+
brightBlack: "#232530",
|
|
1755
|
+
brightRed: "#FAB795",
|
|
1756
|
+
brightGreen: brighten("#29D398", .15),
|
|
1757
|
+
brightYellow: brighten("#FAC29A", .15),
|
|
1758
|
+
brightBlue: brighten("#26BBD9", .15),
|
|
1759
|
+
brightMagenta: "#EE64AC",
|
|
1760
|
+
brightCyan: brighten("#59E1E3", .15),
|
|
1761
|
+
brightWhite: "#D5D8DA",
|
|
1762
|
+
foreground: "#D5D8DA",
|
|
1763
|
+
background: "#1C1E26",
|
|
1764
|
+
cursorColor: "#D5D8DA",
|
|
1765
|
+
cursorText: "#1C1E26",
|
|
1766
|
+
selectionBackground: "#2E303E",
|
|
1767
|
+
selectionForeground: "#D5D8DA"
|
|
1768
|
+
};
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region packages/theme/src/schemes/moonfly.ts
|
|
1771
|
+
/** Moonfly — dark charcoal theme. */
|
|
1772
|
+
const moonfly = {
|
|
1773
|
+
name: "moonfly",
|
|
1774
|
+
dark: true,
|
|
1775
|
+
black: "#121212",
|
|
1776
|
+
red: "#FF5D5D",
|
|
1777
|
+
green: "#8CC85F",
|
|
1778
|
+
yellow: "#E3C78A",
|
|
1779
|
+
blue: "#80A0FF",
|
|
1780
|
+
magenta: "#AE81FF",
|
|
1781
|
+
cyan: "#79DAC8",
|
|
1782
|
+
white: "#808080",
|
|
1783
|
+
brightBlack: "#1C1C1C",
|
|
1784
|
+
brightRed: "#DE935F",
|
|
1785
|
+
brightGreen: brighten("#8CC85F", .15),
|
|
1786
|
+
brightYellow: brighten("#E3C78A", .15),
|
|
1787
|
+
brightBlue: brighten("#80A0FF", .15),
|
|
1788
|
+
brightMagenta: "#FF5189",
|
|
1789
|
+
brightCyan: brighten("#79DAC8", .15),
|
|
1790
|
+
brightWhite: "#C6C6C6",
|
|
1791
|
+
foreground: "#C6C6C6",
|
|
1792
|
+
background: "#080808",
|
|
1793
|
+
cursorColor: "#C6C6C6",
|
|
1794
|
+
cursorText: "#080808",
|
|
1795
|
+
selectionBackground: "#323437",
|
|
1796
|
+
selectionForeground: "#C6C6C6"
|
|
1797
|
+
};
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region packages/theme/src/schemes/nightfly.ts
|
|
1800
|
+
/** Nightfly — midnight-blue dark theme. */
|
|
1801
|
+
const nightfly = {
|
|
1802
|
+
name: "nightfly",
|
|
1803
|
+
dark: true,
|
|
1804
|
+
black: "#081E2F",
|
|
1805
|
+
red: "#FC514E",
|
|
1806
|
+
green: "#A1CD5E",
|
|
1807
|
+
yellow: "#E3D18A",
|
|
1808
|
+
blue: "#82AAFF",
|
|
1809
|
+
magenta: "#C792EA",
|
|
1810
|
+
cyan: "#7FDBCA",
|
|
1811
|
+
white: "#7C8F8F",
|
|
1812
|
+
brightBlack: "#0E293F",
|
|
1813
|
+
brightRed: "#F78C6C",
|
|
1814
|
+
brightGreen: brighten("#A1CD5E", .15),
|
|
1815
|
+
brightYellow: brighten("#E3D18A", .15),
|
|
1816
|
+
brightBlue: brighten("#82AAFF", .15),
|
|
1817
|
+
brightMagenta: "#FF5874",
|
|
1818
|
+
brightCyan: brighten("#7FDBCA", .15),
|
|
1819
|
+
brightWhite: "#C3CCDC",
|
|
1820
|
+
foreground: "#C3CCDC",
|
|
1821
|
+
background: "#011627",
|
|
1822
|
+
cursorColor: "#C3CCDC",
|
|
1823
|
+
cursorText: "#011627",
|
|
1824
|
+
selectionBackground: "#2C3043",
|
|
1825
|
+
selectionForeground: "#C3CCDC"
|
|
1826
|
+
};
|
|
1827
|
+
//#endregion
|
|
1828
|
+
//#region packages/theme/src/schemes/oxocarbon.ts
|
|
1829
|
+
/** Oxocarbon Dark — IBM Carbon-inspired dark variant. */
|
|
1830
|
+
const oxocarbonDark = {
|
|
1831
|
+
name: "oxocarbon-dark",
|
|
1832
|
+
dark: true,
|
|
1833
|
+
black: "#131313",
|
|
1834
|
+
red: "#EE5396",
|
|
1835
|
+
green: "#42BE65",
|
|
1836
|
+
yellow: "#82CFFF",
|
|
1837
|
+
blue: "#78A9FF",
|
|
1838
|
+
magenta: "#BE95FF",
|
|
1839
|
+
cyan: "#08BDBA",
|
|
1840
|
+
white: "#5C5C5C",
|
|
1841
|
+
brightBlack: "#2A2A2A",
|
|
1842
|
+
brightRed: "#FF7EB6",
|
|
1843
|
+
brightGreen: brighten("#42BE65", .15),
|
|
1844
|
+
brightYellow: brighten("#82CFFF", .15),
|
|
1845
|
+
brightBlue: brighten("#78A9FF", .15),
|
|
1846
|
+
brightMagenta: "#FF7EB6",
|
|
1847
|
+
brightCyan: brighten("#08BDBA", .15),
|
|
1848
|
+
brightWhite: "#F3F3F3",
|
|
1849
|
+
foreground: "#F3F3F3",
|
|
1850
|
+
background: "#161616",
|
|
1851
|
+
cursorColor: "#F3F3F3",
|
|
1852
|
+
cursorText: "#161616",
|
|
1853
|
+
selectionBackground: "#404040",
|
|
1854
|
+
selectionForeground: "#F3F3F3"
|
|
1855
|
+
};
|
|
1856
|
+
/** Oxocarbon Light — IBM Carbon-inspired light variant. */
|
|
1857
|
+
const oxocarbonLight = {
|
|
1858
|
+
name: "oxocarbon-light",
|
|
1859
|
+
dark: false,
|
|
1860
|
+
black: "#F3F3F3",
|
|
1861
|
+
red: "#EE5396",
|
|
1862
|
+
green: "#42BE65",
|
|
1863
|
+
yellow: "#FFAB91",
|
|
1864
|
+
blue: "#0F62FE",
|
|
1865
|
+
magenta: "#BE95FF",
|
|
1866
|
+
cyan: "#08BDBA",
|
|
1867
|
+
white: "#90A4AE",
|
|
1868
|
+
brightBlack: "#D5D5D5",
|
|
1869
|
+
brightRed: "#FF6F00",
|
|
1870
|
+
brightGreen: brighten("#42BE65", .15),
|
|
1871
|
+
brightYellow: brighten("#FFAB91", .15),
|
|
1872
|
+
brightBlue: brighten("#0F62FE", .15),
|
|
1873
|
+
brightMagenta: "#FF7EB6",
|
|
1874
|
+
brightCyan: brighten("#08BDBA", .15),
|
|
1875
|
+
brightWhite: "#37474F",
|
|
1876
|
+
foreground: "#37474F",
|
|
1877
|
+
background: "#FFFFFF",
|
|
1878
|
+
cursorColor: "#37474F",
|
|
1879
|
+
cursorText: "#FFFFFF",
|
|
1880
|
+
selectionBackground: "#525252",
|
|
1881
|
+
selectionForeground: "#37474F"
|
|
1882
|
+
};
|
|
1883
|
+
//#endregion
|
|
1884
|
+
//#region packages/theme/src/schemes/sonokai.ts
|
|
1885
|
+
/** Sonokai — vivid dark theme with Monokai-inspired accents. */
|
|
1886
|
+
const sonokai = {
|
|
1887
|
+
name: "sonokai",
|
|
1888
|
+
dark: true,
|
|
1889
|
+
black: "#181819",
|
|
1890
|
+
red: "#FC5D7C",
|
|
1891
|
+
green: "#9ED072",
|
|
1892
|
+
yellow: "#E7C664",
|
|
1893
|
+
blue: "#76CCE0",
|
|
1894
|
+
magenta: "#B39DF3",
|
|
1895
|
+
cyan: "#76CCE0",
|
|
1896
|
+
white: "#7F8490",
|
|
1897
|
+
brightBlack: "#33353F",
|
|
1898
|
+
brightRed: "#F39660",
|
|
1899
|
+
brightGreen: brighten("#9ED072", .15),
|
|
1900
|
+
brightYellow: brighten("#E7C664", .15),
|
|
1901
|
+
brightBlue: brighten("#76CCE0", .15),
|
|
1902
|
+
brightMagenta: "#FC5D7C",
|
|
1903
|
+
brightCyan: brighten("#76CCE0", .15),
|
|
1904
|
+
brightWhite: "#E2E2E3",
|
|
1905
|
+
foreground: "#E2E2E3",
|
|
1906
|
+
background: "#2C2E34",
|
|
1907
|
+
cursorColor: "#E2E2E3",
|
|
1908
|
+
cursorText: "#2C2E34",
|
|
1909
|
+
selectionBackground: "#414550",
|
|
1910
|
+
selectionForeground: "#E2E2E3"
|
|
1911
|
+
};
|
|
1912
|
+
//#endregion
|
|
1913
|
+
//#region packages/theme/src/schemes/edge.ts
|
|
1914
|
+
/** Edge Dark — clean dark variant with balanced accents. */
|
|
1915
|
+
const edgeDark = {
|
|
1916
|
+
name: "edge-dark",
|
|
1917
|
+
dark: true,
|
|
1918
|
+
black: "#202023",
|
|
1919
|
+
red: "#EC7279",
|
|
1920
|
+
green: "#A0C980",
|
|
1921
|
+
yellow: "#DEB974",
|
|
1922
|
+
blue: "#6CB6EB",
|
|
1923
|
+
magenta: "#D38AEA",
|
|
1924
|
+
cyan: "#5DBBC1",
|
|
1925
|
+
white: "#758094",
|
|
1926
|
+
brightBlack: "#33353F",
|
|
1927
|
+
brightRed: "#DEB974",
|
|
1928
|
+
brightGreen: brighten("#A0C980", .15),
|
|
1929
|
+
brightYellow: brighten("#DEB974", .15),
|
|
1930
|
+
brightBlue: brighten("#6CB6EB", .15),
|
|
1931
|
+
brightMagenta: "#EC7279",
|
|
1932
|
+
brightCyan: brighten("#5DBBC1", .15),
|
|
1933
|
+
brightWhite: "#C5CDD9",
|
|
1934
|
+
foreground: "#C5CDD9",
|
|
1935
|
+
background: "#2C2E34",
|
|
1936
|
+
cursorColor: "#C5CDD9",
|
|
1937
|
+
cursorText: "#2C2E34",
|
|
1938
|
+
selectionBackground: "#414550",
|
|
1939
|
+
selectionForeground: "#C5CDD9"
|
|
1940
|
+
};
|
|
1941
|
+
/** Edge Light — clean, readable light variant. */
|
|
1942
|
+
const edgeLight = {
|
|
1943
|
+
name: "edge-light",
|
|
1944
|
+
dark: false,
|
|
1945
|
+
black: "#DDE2E7",
|
|
1946
|
+
red: "#D05858",
|
|
1947
|
+
green: "#608E32",
|
|
1948
|
+
yellow: "#BE7E05",
|
|
1949
|
+
blue: "#5079BE",
|
|
1950
|
+
magenta: "#B05CCC",
|
|
1951
|
+
cyan: "#3A8B84",
|
|
1952
|
+
white: "#8790A0",
|
|
1953
|
+
brightBlack: "#EEF1F4",
|
|
1954
|
+
brightRed: "#BE7E05",
|
|
1955
|
+
brightGreen: brighten("#608E32", .15),
|
|
1956
|
+
brightYellow: brighten("#BE7E05", .15),
|
|
1957
|
+
brightBlue: brighten("#5079BE", .15),
|
|
1958
|
+
brightMagenta: "#D05858",
|
|
1959
|
+
brightCyan: brighten("#3A8B84", .15),
|
|
1960
|
+
brightWhite: "#4B505B",
|
|
1961
|
+
foreground: "#4B505B",
|
|
1962
|
+
background: "#FAFAFA",
|
|
1963
|
+
cursorColor: "#4B505B",
|
|
1964
|
+
cursorText: "#FAFAFA",
|
|
1965
|
+
selectionBackground: "#DDE2E7",
|
|
1966
|
+
selectionForeground: "#4B505B"
|
|
1967
|
+
};
|
|
1968
|
+
//#endregion
|
|
1969
|
+
//#region packages/theme/src/schemes/modus.ts
|
|
1970
|
+
/** Modus Vivendi — elegant dark theme with maximum legibility. */
|
|
1971
|
+
const modusVivendi = {
|
|
1972
|
+
name: "modus-vivendi",
|
|
1973
|
+
dark: true,
|
|
1974
|
+
black: "#000000",
|
|
1975
|
+
red: "#FF5F59",
|
|
1976
|
+
green: "#44BC44",
|
|
1977
|
+
yellow: "#D0BC00",
|
|
1978
|
+
blue: "#2FAFFF",
|
|
1979
|
+
magenta: "#B6A0FF",
|
|
1980
|
+
cyan: "#00D3D0",
|
|
1981
|
+
white: "#989898",
|
|
1982
|
+
brightBlack: "#1E1E1E",
|
|
1983
|
+
brightRed: "#FEC43F",
|
|
1984
|
+
brightGreen: brighten("#44BC44", .15),
|
|
1985
|
+
brightYellow: brighten("#D0BC00", .15),
|
|
1986
|
+
brightBlue: brighten("#2FAFFF", .15),
|
|
1987
|
+
brightMagenta: "#FEACD0",
|
|
1988
|
+
brightCyan: brighten("#00D3D0", .15),
|
|
1989
|
+
brightWhite: "#FFFFFF",
|
|
1990
|
+
foreground: "#FFFFFF",
|
|
1991
|
+
background: "#000000",
|
|
1992
|
+
cursorColor: "#FFFFFF",
|
|
1993
|
+
cursorText: "#000000",
|
|
1994
|
+
selectionBackground: "#535353",
|
|
1995
|
+
selectionForeground: "#FFFFFF"
|
|
1996
|
+
};
|
|
1997
|
+
/** Modus Operandi — elegant light theme with maximum legibility. */
|
|
1998
|
+
const modusOperandi = {
|
|
1999
|
+
name: "modus-operandi",
|
|
2000
|
+
dark: false,
|
|
2001
|
+
black: "#E0E0E0",
|
|
2002
|
+
red: "#A60000",
|
|
2003
|
+
green: "#006800",
|
|
2004
|
+
yellow: "#6F5500",
|
|
2005
|
+
blue: "#0031A9",
|
|
2006
|
+
magenta: "#531AB6",
|
|
2007
|
+
cyan: "#005E8B",
|
|
2008
|
+
white: "#595959",
|
|
2009
|
+
brightBlack: "#F2F2F2",
|
|
2010
|
+
brightRed: "#884900",
|
|
2011
|
+
brightGreen: brighten("#006800", .15),
|
|
2012
|
+
brightYellow: brighten("#6F5500", .15),
|
|
2013
|
+
brightBlue: brighten("#0031A9", .15),
|
|
2014
|
+
brightMagenta: "#721045",
|
|
2015
|
+
brightCyan: brighten("#005E8B", .15),
|
|
2016
|
+
brightWhite: "#000000",
|
|
2017
|
+
foreground: "#000000",
|
|
2018
|
+
background: "#FFFFFF",
|
|
2019
|
+
cursorColor: "#000000",
|
|
2020
|
+
cursorText: "#FFFFFF",
|
|
2021
|
+
selectionBackground: "#9F9F9F",
|
|
2022
|
+
selectionForeground: "#000000"
|
|
2023
|
+
};
|
|
2024
|
+
//#endregion
|
|
2025
|
+
//#region packages/theme/src/schemes/github.ts
|
|
2026
|
+
/** GitHub Dark — GitHub's dark terminal theme. */
|
|
2027
|
+
const githubDark = {
|
|
2028
|
+
name: "github-dark",
|
|
2029
|
+
dark: true,
|
|
2030
|
+
black: "#000000",
|
|
2031
|
+
red: "#f78166",
|
|
2032
|
+
green: "#56d364",
|
|
2033
|
+
yellow: "#e3b341",
|
|
2034
|
+
blue: "#6ca4f8",
|
|
2035
|
+
magenta: "#db61a2",
|
|
2036
|
+
cyan: "#2b7489",
|
|
2037
|
+
white: "#ffffff",
|
|
2038
|
+
brightBlack: "#4d4d4d",
|
|
2039
|
+
brightRed: "#f78166",
|
|
2040
|
+
brightGreen: "#56d364",
|
|
2041
|
+
brightYellow: "#e3b341",
|
|
2042
|
+
brightBlue: "#6ca4f8",
|
|
2043
|
+
brightMagenta: "#db61a2",
|
|
2044
|
+
brightCyan: "#2b7489",
|
|
2045
|
+
brightWhite: "#ffffff",
|
|
2046
|
+
foreground: "#8b949e",
|
|
2047
|
+
background: "#101216",
|
|
2048
|
+
cursorColor: "#c9d1d9",
|
|
2049
|
+
cursorText: "#101216",
|
|
2050
|
+
selectionBackground: "#3b5070",
|
|
2051
|
+
selectionForeground: "#c9d1d9"
|
|
2052
|
+
};
|
|
2053
|
+
/** GitHub Light — GitHub's light terminal theme. */
|
|
2054
|
+
const githubLight = {
|
|
2055
|
+
name: "github-light",
|
|
2056
|
+
dark: false,
|
|
2057
|
+
black: "#3e3e3e",
|
|
2058
|
+
red: "#970b16",
|
|
2059
|
+
green: "#07962a",
|
|
2060
|
+
yellow: "#f8eec7",
|
|
2061
|
+
blue: "#003e8a",
|
|
2062
|
+
magenta: "#e94691",
|
|
2063
|
+
cyan: "#89d1ec",
|
|
2064
|
+
white: "#ffffff",
|
|
2065
|
+
brightBlack: "#666666",
|
|
2066
|
+
brightRed: "#de0000",
|
|
2067
|
+
brightGreen: "#87d5a2",
|
|
2068
|
+
brightYellow: "#f1d007",
|
|
2069
|
+
brightBlue: "#2e6cba",
|
|
2070
|
+
brightMagenta: "#ffa29f",
|
|
2071
|
+
brightCyan: "#1cfafe",
|
|
2072
|
+
brightWhite: "#ffffff",
|
|
2073
|
+
foreground: "#3e3e3e",
|
|
2074
|
+
background: "#f4f4f4",
|
|
2075
|
+
cursorColor: "#3f3f3f",
|
|
2076
|
+
cursorText: "#f4f4f4",
|
|
2077
|
+
selectionBackground: "#a9c1e2",
|
|
2078
|
+
selectionForeground: "#3e3e3e"
|
|
2079
|
+
};
|
|
2080
|
+
//#endregion
|
|
2081
|
+
//#region packages/theme/src/schemes/cobalt2.ts
|
|
2082
|
+
/** Cobalt2 — vibrant dark blue theme by Wes Bos. */
|
|
2083
|
+
const cobalt2 = {
|
|
2084
|
+
name: "cobalt2",
|
|
2085
|
+
dark: true,
|
|
2086
|
+
black: "#000000",
|
|
2087
|
+
red: "#ff0000",
|
|
2088
|
+
green: "#38de21",
|
|
2089
|
+
yellow: "#ffe50a",
|
|
2090
|
+
blue: "#1460d2",
|
|
2091
|
+
magenta: "#ff005d",
|
|
2092
|
+
cyan: "#00bbbb",
|
|
2093
|
+
white: "#bbbbbb",
|
|
2094
|
+
brightBlack: "#555555",
|
|
2095
|
+
brightRed: "#f40e17",
|
|
2096
|
+
brightGreen: "#3bd01d",
|
|
2097
|
+
brightYellow: "#edc809",
|
|
2098
|
+
brightBlue: "#5555ff",
|
|
2099
|
+
brightMagenta: "#ff55ff",
|
|
2100
|
+
brightCyan: "#6ae3fa",
|
|
2101
|
+
brightWhite: "#ffffff",
|
|
2102
|
+
foreground: "#ffffff",
|
|
2103
|
+
background: "#132738",
|
|
2104
|
+
cursorColor: "#f0cc09",
|
|
2105
|
+
cursorText: "#132738",
|
|
2106
|
+
selectionBackground: "#18354f",
|
|
2107
|
+
selectionForeground: "#ffffff"
|
|
2108
|
+
};
|
|
2109
|
+
//#endregion
|
|
2110
|
+
//#region packages/theme/src/schemes/synthwave.ts
|
|
2111
|
+
/** Synthwave — classic retro terminal neon. */
|
|
2112
|
+
const synthwave = {
|
|
2113
|
+
name: "synthwave",
|
|
2114
|
+
dark: true,
|
|
2115
|
+
black: "#000000",
|
|
2116
|
+
red: "#f6188f",
|
|
2117
|
+
green: "#1ebb2b",
|
|
2118
|
+
yellow: "#fdf834",
|
|
2119
|
+
blue: "#2186ec",
|
|
2120
|
+
magenta: "#f85a21",
|
|
2121
|
+
cyan: "#12c3e2",
|
|
2122
|
+
white: "#ffffff",
|
|
2123
|
+
brightBlack: "#000000",
|
|
2124
|
+
brightRed: "#f841a0",
|
|
2125
|
+
brightGreen: "#25c141",
|
|
2126
|
+
brightYellow: "#fdf454",
|
|
2127
|
+
brightBlue: "#2f9ded",
|
|
2128
|
+
brightMagenta: "#f97137",
|
|
2129
|
+
brightCyan: "#19cde6",
|
|
2130
|
+
brightWhite: "#ffffff",
|
|
2131
|
+
foreground: "#dad9c7",
|
|
2132
|
+
background: "#000000",
|
|
2133
|
+
cursorColor: "#19cde6",
|
|
2134
|
+
cursorText: "#000000",
|
|
2135
|
+
selectionBackground: "#19cde6",
|
|
2136
|
+
selectionForeground: "#000000"
|
|
2137
|
+
};
|
|
2138
|
+
/** Synthwave '84 — the neon VS Code theme. */
|
|
2139
|
+
const synthwave84 = {
|
|
2140
|
+
name: "synthwave-84",
|
|
2141
|
+
dark: true,
|
|
2142
|
+
black: "#fefefe",
|
|
2143
|
+
red: "#f97e72",
|
|
2144
|
+
green: "#72f1b8",
|
|
2145
|
+
yellow: "#fede5d",
|
|
2146
|
+
blue: "#6d77b3",
|
|
2147
|
+
magenta: "#c792ea",
|
|
2148
|
+
cyan: "#f772e0",
|
|
2149
|
+
white: "#fefefe",
|
|
2150
|
+
brightBlack: "#fefefe",
|
|
2151
|
+
brightRed: "#f88414",
|
|
2152
|
+
brightGreen: "#72f1b8",
|
|
2153
|
+
brightYellow: "#fff951",
|
|
2154
|
+
brightBlue: "#36f9f6",
|
|
2155
|
+
brightMagenta: "#e1acff",
|
|
2156
|
+
brightCyan: "#f92aad",
|
|
2157
|
+
brightWhite: "#fefefe",
|
|
2158
|
+
foreground: "#f0eff1",
|
|
2159
|
+
background: "#2a2139",
|
|
2160
|
+
cursorColor: "#72f1b8",
|
|
2161
|
+
cursorText: "#2a2139",
|
|
2162
|
+
selectionBackground: "#181521",
|
|
2163
|
+
selectionForeground: "#f0eff1"
|
|
2164
|
+
};
|
|
2165
|
+
//#endregion
|
|
2166
|
+
//#region packages/theme/src/schemes/tomorrow-night.ts
|
|
2167
|
+
/** Tomorrow Night — the original dark variant. */
|
|
2168
|
+
const tomorrowNight = {
|
|
2169
|
+
name: "tomorrow-night",
|
|
2170
|
+
dark: true,
|
|
2171
|
+
black: "#282a2e",
|
|
2172
|
+
red: "#cc6666",
|
|
2173
|
+
green: "#b5bd68",
|
|
2174
|
+
yellow: "#f0c674",
|
|
2175
|
+
blue: "#81a2be",
|
|
2176
|
+
magenta: "#b294bb",
|
|
2177
|
+
cyan: "#8abeb7",
|
|
2178
|
+
white: "#e0e0e0",
|
|
2179
|
+
brightBlack: "#373b41",
|
|
2180
|
+
brightRed: "#cc6666",
|
|
2181
|
+
brightGreen: "#b5bd68",
|
|
2182
|
+
brightYellow: "#f0c674",
|
|
2183
|
+
brightBlue: "#81a2be",
|
|
2184
|
+
brightMagenta: "#b294bb",
|
|
2185
|
+
brightCyan: "#8abeb7",
|
|
2186
|
+
brightWhite: "#ffffff",
|
|
2187
|
+
foreground: "#c5c8c6",
|
|
2188
|
+
background: "#1d1f21",
|
|
2189
|
+
cursorColor: "#c5c8c6",
|
|
2190
|
+
cursorText: "#1d1f21",
|
|
2191
|
+
selectionBackground: "#373b41",
|
|
2192
|
+
selectionForeground: "#c5c8c6"
|
|
2193
|
+
};
|
|
2194
|
+
/** Tomorrow Night Blue — deep blue variant. */
|
|
2195
|
+
const tomorrowNightBlue = {
|
|
2196
|
+
name: "tomorrow-night-blue",
|
|
2197
|
+
dark: true,
|
|
2198
|
+
black: "#000000",
|
|
2199
|
+
red: "#ff9da4",
|
|
2200
|
+
green: "#d1f1a9",
|
|
2201
|
+
yellow: "#ffeead",
|
|
2202
|
+
blue: "#bbdaff",
|
|
2203
|
+
magenta: "#ebbbff",
|
|
2204
|
+
cyan: "#99ffff",
|
|
2205
|
+
white: "#ffffff",
|
|
2206
|
+
brightBlack: "#000000",
|
|
2207
|
+
brightRed: "#ff9da4",
|
|
2208
|
+
brightGreen: "#d1f1a9",
|
|
2209
|
+
brightYellow: "#ffeead",
|
|
2210
|
+
brightBlue: "#bbdaff",
|
|
2211
|
+
brightMagenta: "#ebbbff",
|
|
2212
|
+
brightCyan: "#99ffff",
|
|
2213
|
+
brightWhite: "#ffffff",
|
|
2214
|
+
foreground: "#ffffff",
|
|
2215
|
+
background: "#002451",
|
|
2216
|
+
cursorColor: "#ffffff",
|
|
2217
|
+
cursorText: "#002451",
|
|
2218
|
+
selectionBackground: "#003f8e",
|
|
2219
|
+
selectionForeground: "#ffffff"
|
|
2220
|
+
};
|
|
2221
|
+
/** Tomorrow Night Eighties — muted retro variant. */
|
|
2222
|
+
const tomorrowNightEighties = {
|
|
2223
|
+
name: "tomorrow-night-eighties",
|
|
2224
|
+
dark: true,
|
|
2225
|
+
black: "#393939",
|
|
2226
|
+
red: "#f2777a",
|
|
2227
|
+
green: "#99cc99",
|
|
2228
|
+
yellow: "#ffcc66",
|
|
2229
|
+
blue: "#6699cc",
|
|
2230
|
+
magenta: "#cc99cc",
|
|
2231
|
+
cyan: "#66cccc",
|
|
2232
|
+
white: "#e0e0e0",
|
|
2233
|
+
brightBlack: "#515151",
|
|
2234
|
+
brightRed: "#f2777a",
|
|
2235
|
+
brightGreen: "#99cc99",
|
|
2236
|
+
brightYellow: "#ffcc66",
|
|
2237
|
+
brightBlue: "#6699cc",
|
|
2238
|
+
brightMagenta: "#cc99cc",
|
|
2239
|
+
brightCyan: "#66cccc",
|
|
2240
|
+
brightWhite: "#ffffff",
|
|
2241
|
+
foreground: "#cccccc",
|
|
2242
|
+
background: "#2d2d2d",
|
|
2243
|
+
cursorColor: "#cccccc",
|
|
2244
|
+
cursorText: "#2d2d2d",
|
|
2245
|
+
selectionBackground: "#515151",
|
|
2246
|
+
selectionForeground: "#cccccc"
|
|
2247
|
+
};
|
|
2248
|
+
//#endregion
|
|
2249
|
+
//#region packages/theme/src/schemes/zenburn.ts
|
|
2250
|
+
/** Zenburn — Jani Nurminen's low-contrast dark theme. */
|
|
2251
|
+
const zenburn = {
|
|
2252
|
+
name: "zenburn",
|
|
2253
|
+
dark: true,
|
|
2254
|
+
black: "#4d4d4d",
|
|
2255
|
+
red: "#705050",
|
|
2256
|
+
green: "#60b48a",
|
|
2257
|
+
yellow: "#f0dfaf",
|
|
2258
|
+
blue: "#506070",
|
|
2259
|
+
magenta: "#dc8cc3",
|
|
2260
|
+
cyan: "#8cd0d3",
|
|
2261
|
+
white: "#dcdccc",
|
|
2262
|
+
brightBlack: "#709080",
|
|
2263
|
+
brightRed: "#dca3a3",
|
|
2264
|
+
brightGreen: "#c3bf9f",
|
|
2265
|
+
brightYellow: "#e0cf9f",
|
|
2266
|
+
brightBlue: "#94bff3",
|
|
2267
|
+
brightMagenta: "#ec93d3",
|
|
2268
|
+
brightCyan: "#93e0e3",
|
|
2269
|
+
brightWhite: "#ffffff",
|
|
2270
|
+
foreground: "#dcdccc",
|
|
2271
|
+
background: "#3f3f3f",
|
|
2272
|
+
cursorColor: "#73635a",
|
|
2273
|
+
cursorText: "#3f3f3f",
|
|
2274
|
+
selectionBackground: "#21322f",
|
|
2275
|
+
selectionForeground: "#dcdccc"
|
|
2276
|
+
};
|
|
2277
|
+
//#endregion
|
|
2278
|
+
//#region packages/theme/src/schemes/ubuntu.ts
|
|
2279
|
+
/** Ubuntu — the iconic purple terminal from Ubuntu Linux. */
|
|
2280
|
+
const ubuntu = {
|
|
2281
|
+
name: "ubuntu",
|
|
2282
|
+
dark: true,
|
|
2283
|
+
black: "#2e3436",
|
|
2284
|
+
red: "#cc0000",
|
|
2285
|
+
green: "#4e9a06",
|
|
2286
|
+
yellow: "#c4a000",
|
|
2287
|
+
blue: "#3465a4",
|
|
2288
|
+
magenta: "#75507b",
|
|
2289
|
+
cyan: "#06989a",
|
|
2290
|
+
white: "#d3d7cf",
|
|
2291
|
+
brightBlack: "#555753",
|
|
2292
|
+
brightRed: "#ef2929",
|
|
2293
|
+
brightGreen: "#8ae234",
|
|
2294
|
+
brightYellow: "#fce94f",
|
|
2295
|
+
brightBlue: "#729fcf",
|
|
2296
|
+
brightMagenta: "#ad7fa8",
|
|
2297
|
+
brightCyan: "#34e2e2",
|
|
2298
|
+
brightWhite: "#eeeeec",
|
|
2299
|
+
foreground: "#eeeeec",
|
|
2300
|
+
background: "#300a24",
|
|
2301
|
+
cursorColor: "#bbbbbb",
|
|
2302
|
+
cursorText: "#300a24",
|
|
2303
|
+
selectionBackground: "#b5d5ff",
|
|
2304
|
+
selectionForeground: "#300a24"
|
|
2305
|
+
};
|
|
2306
|
+
//#endregion
|
|
2307
|
+
//#region packages/theme/src/schemes/tango.ts
|
|
2308
|
+
/** Tango Dark — GNOME terminal's classic dark Tango theme. */
|
|
2309
|
+
const tangoDark = {
|
|
2310
|
+
name: "tango-dark",
|
|
2311
|
+
dark: true,
|
|
2312
|
+
black: "#000000",
|
|
2313
|
+
red: "#cc0000",
|
|
2314
|
+
green: "#4e9a06",
|
|
2315
|
+
yellow: "#c4a000",
|
|
2316
|
+
blue: "#3465a4",
|
|
2317
|
+
magenta: "#75507b",
|
|
2318
|
+
cyan: "#06989a",
|
|
2319
|
+
white: "#d3d7cf",
|
|
2320
|
+
brightBlack: "#555753",
|
|
2321
|
+
brightRed: "#ef2929",
|
|
2322
|
+
brightGreen: "#8ae234",
|
|
2323
|
+
brightYellow: "#fce94f",
|
|
2324
|
+
brightBlue: "#729fcf",
|
|
2325
|
+
brightMagenta: "#ad7fa8",
|
|
2326
|
+
brightCyan: "#34e2e2",
|
|
2327
|
+
brightWhite: "#eeeeec",
|
|
2328
|
+
foreground: "#ffffff",
|
|
2329
|
+
background: "#000000",
|
|
2330
|
+
cursorColor: "#ffffff",
|
|
2331
|
+
cursorText: "#000000",
|
|
2332
|
+
selectionBackground: "#b5d5ff",
|
|
2333
|
+
selectionForeground: "#000000"
|
|
2334
|
+
};
|
|
2335
|
+
/** Tango Light — GNOME terminal's light Tango variant. */
|
|
2336
|
+
const tangoLight = {
|
|
2337
|
+
name: "tango-light",
|
|
2338
|
+
dark: false,
|
|
2339
|
+
black: "#000000",
|
|
2340
|
+
red: "#cc0000",
|
|
2341
|
+
green: "#4e9a06",
|
|
2342
|
+
yellow: "#c4a000",
|
|
2343
|
+
blue: "#3465a4",
|
|
2344
|
+
magenta: "#75507b",
|
|
2345
|
+
cyan: "#06989a",
|
|
2346
|
+
white: "#d3d7cf",
|
|
2347
|
+
brightBlack: "#555753",
|
|
2348
|
+
brightRed: "#ef2929",
|
|
2349
|
+
brightGreen: "#8ae234",
|
|
2350
|
+
brightYellow: "#fce94f",
|
|
2351
|
+
brightBlue: "#729fcf",
|
|
2352
|
+
brightMagenta: "#ad7fa8",
|
|
2353
|
+
brightCyan: "#34e2e2",
|
|
2354
|
+
brightWhite: "#eeeeec",
|
|
2355
|
+
foreground: "#000000",
|
|
2356
|
+
background: "#ffffff",
|
|
2357
|
+
cursorColor: "#000000",
|
|
2358
|
+
cursorText: "#ffffff",
|
|
2359
|
+
selectionBackground: "#b5d5ff",
|
|
2360
|
+
selectionForeground: "#000000"
|
|
2361
|
+
};
|
|
2362
|
+
//#endregion
|
|
2363
|
+
//#region packages/theme/src/schemes/cyberpunk.ts
|
|
2364
|
+
/** Cyberpunk — neon colors on deep purple. */
|
|
2365
|
+
const cyberpunk = {
|
|
2366
|
+
name: "cyberpunk",
|
|
2367
|
+
dark: true,
|
|
2368
|
+
black: "#000000",
|
|
2369
|
+
red: "#ff7092",
|
|
2370
|
+
green: "#00fbac",
|
|
2371
|
+
yellow: "#fffa6a",
|
|
2372
|
+
blue: "#00bfff",
|
|
2373
|
+
magenta: "#df95ff",
|
|
2374
|
+
cyan: "#86cbfe",
|
|
2375
|
+
white: "#ffffff",
|
|
2376
|
+
brightBlack: "#000000",
|
|
2377
|
+
brightRed: "#ff8aa4",
|
|
2378
|
+
brightGreen: "#21f6bc",
|
|
2379
|
+
brightYellow: "#fff787",
|
|
2380
|
+
brightBlue: "#1bccfd",
|
|
2381
|
+
brightMagenta: "#e6aefe",
|
|
2382
|
+
brightCyan: "#99d6fc",
|
|
2383
|
+
brightWhite: "#ffffff",
|
|
2384
|
+
foreground: "#e5e5e5",
|
|
2385
|
+
background: "#332a57",
|
|
2386
|
+
cursorColor: "#21f6bc",
|
|
2387
|
+
cursorText: "#332a57",
|
|
2388
|
+
selectionBackground: "#c1deff",
|
|
2389
|
+
selectionForeground: "#332a57"
|
|
2390
|
+
};
|
|
2391
|
+
//#endregion
|
|
2392
|
+
//#region packages/theme/src/schemes/vscode.ts
|
|
2393
|
+
/** VS Code Dark+ — the default VS Code dark terminal theme. */
|
|
2394
|
+
const vscodeDark = {
|
|
2395
|
+
name: "vscode-dark",
|
|
2396
|
+
dark: true,
|
|
2397
|
+
black: "#000000",
|
|
2398
|
+
red: "#cd3131",
|
|
2399
|
+
green: "#0dbc79",
|
|
2400
|
+
yellow: "#e5e510",
|
|
2401
|
+
blue: "#2472c8",
|
|
2402
|
+
magenta: "#bc3fbc",
|
|
2403
|
+
cyan: "#11a8cd",
|
|
2404
|
+
white: "#e5e5e5",
|
|
2405
|
+
brightBlack: "#666666",
|
|
2406
|
+
brightRed: "#f14c4c",
|
|
2407
|
+
brightGreen: "#23d18b",
|
|
2408
|
+
brightYellow: "#f5f543",
|
|
2409
|
+
brightBlue: "#3b8eea",
|
|
2410
|
+
brightMagenta: "#d670d6",
|
|
2411
|
+
brightCyan: "#29b8db",
|
|
2412
|
+
brightWhite: "#e5e5e5",
|
|
2413
|
+
foreground: "#cccccc",
|
|
2414
|
+
background: "#1e1e1e",
|
|
2415
|
+
cursorColor: "#ffffff",
|
|
2416
|
+
cursorText: "#1e1e1e",
|
|
2417
|
+
selectionBackground: "#3a3d41",
|
|
2418
|
+
selectionForeground: "#cccccc"
|
|
2419
|
+
};
|
|
2420
|
+
//#endregion
|
|
2421
|
+
//#region packages/theme/src/schemes/one-light.ts
|
|
2422
|
+
/** One Light — the classic Atom editor light theme. */
|
|
2423
|
+
const oneLight = {
|
|
2424
|
+
name: "one-light",
|
|
2425
|
+
dark: false,
|
|
2426
|
+
black: "#000000",
|
|
2427
|
+
red: "#de3e35",
|
|
2428
|
+
green: "#3f953a",
|
|
2429
|
+
yellow: "#d2b67c",
|
|
2430
|
+
blue: "#2f5af3",
|
|
2431
|
+
magenta: "#950095",
|
|
2432
|
+
cyan: "#3f953a",
|
|
2433
|
+
white: "#bbbbbb",
|
|
2434
|
+
brightBlack: "#000000",
|
|
2435
|
+
brightRed: "#de3e35",
|
|
2436
|
+
brightGreen: "#3f953a",
|
|
2437
|
+
brightYellow: "#d2b67c",
|
|
2438
|
+
brightBlue: "#2f5af3",
|
|
2439
|
+
brightMagenta: "#a00095",
|
|
2440
|
+
brightCyan: "#3f953a",
|
|
2441
|
+
brightWhite: "#ffffff",
|
|
2442
|
+
foreground: "#2a2c33",
|
|
2443
|
+
background: "#f9f9f9",
|
|
2444
|
+
cursorColor: "#bbbbbb",
|
|
2445
|
+
cursorText: "#f9f9f9",
|
|
2446
|
+
selectionBackground: "#ededed",
|
|
2447
|
+
selectionForeground: "#2a2c33"
|
|
2448
|
+
};
|
|
2449
|
+
/** One Half Dark — sonph's One-inspired dark theme. */
|
|
2450
|
+
const oneHalfDark = {
|
|
2451
|
+
name: "one-half-dark",
|
|
2452
|
+
dark: true,
|
|
2453
|
+
black: "#282c34",
|
|
2454
|
+
red: "#e06c75",
|
|
2455
|
+
green: "#98c379",
|
|
2456
|
+
yellow: "#e5c07b",
|
|
2457
|
+
blue: "#61afef",
|
|
2458
|
+
magenta: "#c678dd",
|
|
2459
|
+
cyan: "#56b6c2",
|
|
2460
|
+
white: "#dcdfe4",
|
|
2461
|
+
brightBlack: "#282c34",
|
|
2462
|
+
brightRed: "#e06c75",
|
|
2463
|
+
brightGreen: "#98c379",
|
|
2464
|
+
brightYellow: "#e5c07b",
|
|
2465
|
+
brightBlue: "#61afef",
|
|
2466
|
+
brightMagenta: "#c678dd",
|
|
2467
|
+
brightCyan: "#56b6c2",
|
|
2468
|
+
brightWhite: "#dcdfe4",
|
|
2469
|
+
foreground: "#dcdfe4",
|
|
2470
|
+
background: "#282c34",
|
|
2471
|
+
cursorColor: "#a3b3cc",
|
|
2472
|
+
cursorText: "#282c34",
|
|
2473
|
+
selectionBackground: "#474e5d",
|
|
2474
|
+
selectionForeground: "#dcdfe4"
|
|
2475
|
+
};
|
|
2476
|
+
/** One Half Light — sonph's One-inspired light theme. */
|
|
2477
|
+
const oneHalfLight = {
|
|
2478
|
+
name: "one-half-light",
|
|
2479
|
+
dark: false,
|
|
2480
|
+
black: "#383a42",
|
|
2481
|
+
red: "#e45649",
|
|
2482
|
+
green: "#50a14f",
|
|
2483
|
+
yellow: "#c18401",
|
|
2484
|
+
blue: "#0184bc",
|
|
2485
|
+
magenta: "#a626a4",
|
|
2486
|
+
cyan: "#0997b3",
|
|
2487
|
+
white: "#fafafa",
|
|
2488
|
+
brightBlack: "#4f525e",
|
|
2489
|
+
brightRed: "#e06c75",
|
|
2490
|
+
brightGreen: "#98c379",
|
|
2491
|
+
brightYellow: "#e5c07b",
|
|
2492
|
+
brightBlue: "#61afef",
|
|
2493
|
+
brightMagenta: "#c678dd",
|
|
2494
|
+
brightCyan: "#56b6c2",
|
|
2495
|
+
brightWhite: "#ffffff",
|
|
2496
|
+
foreground: "#383a42",
|
|
2497
|
+
background: "#fafafa",
|
|
2498
|
+
cursorColor: "#bfceff",
|
|
2499
|
+
cursorText: "#fafafa",
|
|
2500
|
+
selectionBackground: "#bfceff",
|
|
2501
|
+
selectionForeground: "#383a42"
|
|
2502
|
+
};
|
|
2503
|
+
//#endregion
|
|
2504
|
+
//#region packages/theme/src/schemes/night-owl.ts
|
|
2505
|
+
/** Night Owl Light — the light variant by Sarah Drasner. */
|
|
2506
|
+
const nightOwlLight = {
|
|
2507
|
+
name: "night-owl-light",
|
|
2508
|
+
dark: false,
|
|
2509
|
+
black: "#011627",
|
|
2510
|
+
red: "#d3423e",
|
|
2511
|
+
green: "#2aa298",
|
|
2512
|
+
yellow: "#daaa01",
|
|
2513
|
+
blue: "#4876d6",
|
|
2514
|
+
magenta: "#403f53",
|
|
2515
|
+
cyan: "#08916a",
|
|
2516
|
+
white: "#7a8181",
|
|
2517
|
+
brightBlack: "#7a8181",
|
|
2518
|
+
brightRed: "#f76e6e",
|
|
2519
|
+
brightGreen: "#49d0c5",
|
|
2520
|
+
brightYellow: "#dac26b",
|
|
2521
|
+
brightBlue: "#5ca7e4",
|
|
2522
|
+
brightMagenta: "#697098",
|
|
2523
|
+
brightCyan: "#00c990",
|
|
2524
|
+
brightWhite: "#989fb1",
|
|
2525
|
+
foreground: "#403f53",
|
|
2526
|
+
background: "#ffffff",
|
|
2527
|
+
cursorColor: "#403f53",
|
|
2528
|
+
cursorText: "#ffffff",
|
|
2529
|
+
selectionBackground: "#f2f2f2",
|
|
2530
|
+
selectionForeground: "#403f53"
|
|
2531
|
+
};
|
|
2532
|
+
//#endregion
|
|
2533
|
+
//#region packages/theme/src/schemes/shades-of-purple.ts
|
|
2534
|
+
/** Shades of Purple — vivid purple-based dark theme. */
|
|
2535
|
+
const shadesOfPurple = {
|
|
2536
|
+
name: "shades-of-purple",
|
|
2537
|
+
dark: true,
|
|
2538
|
+
black: "#000000",
|
|
2539
|
+
red: "#d90429",
|
|
2540
|
+
green: "#3ad900",
|
|
2541
|
+
yellow: "#ffe700",
|
|
2542
|
+
blue: "#6943ff",
|
|
2543
|
+
magenta: "#ff2c70",
|
|
2544
|
+
cyan: "#00c5c7",
|
|
2545
|
+
white: "#c7c7c7",
|
|
2546
|
+
brightBlack: "#686868",
|
|
2547
|
+
brightRed: "#f92a1c",
|
|
2548
|
+
brightGreen: "#43d426",
|
|
2549
|
+
brightYellow: "#f1d000",
|
|
2550
|
+
brightBlue: "#6871ff",
|
|
2551
|
+
brightMagenta: "#ff77ff",
|
|
2552
|
+
brightCyan: "#79e8fb",
|
|
2553
|
+
brightWhite: "#ffffff",
|
|
2554
|
+
foreground: "#ffffff",
|
|
2555
|
+
background: "#1e1d40",
|
|
2556
|
+
cursorColor: "#fad000",
|
|
2557
|
+
cursorText: "#1e1d40",
|
|
2558
|
+
selectionBackground: "#b362ff",
|
|
2559
|
+
selectionForeground: "#ffffff"
|
|
2560
|
+
};
|
|
2561
|
+
//#endregion
|
|
2562
|
+
//#region packages/theme/src/schemes/homebrew.ts
|
|
2563
|
+
/** Homebrew — the classic green phosphor terminal look. */
|
|
2564
|
+
const homebrew = {
|
|
2565
|
+
name: "homebrew",
|
|
2566
|
+
dark: true,
|
|
2567
|
+
black: "#000000",
|
|
2568
|
+
red: "#990000",
|
|
2569
|
+
green: "#00a600",
|
|
2570
|
+
yellow: "#999900",
|
|
2571
|
+
blue: "#0000b2",
|
|
2572
|
+
magenta: "#b200b2",
|
|
2573
|
+
cyan: "#00a6b2",
|
|
2574
|
+
white: "#bfbfbf",
|
|
2575
|
+
brightBlack: "#666666",
|
|
2576
|
+
brightRed: "#e50000",
|
|
2577
|
+
brightGreen: "#00d900",
|
|
2578
|
+
brightYellow: "#e5e500",
|
|
2579
|
+
brightBlue: "#0000ff",
|
|
2580
|
+
brightMagenta: "#e500e5",
|
|
2581
|
+
brightCyan: "#00e5e5",
|
|
2582
|
+
brightWhite: "#e5e5e5",
|
|
2583
|
+
foreground: "#00ff00",
|
|
2584
|
+
background: "#000000",
|
|
2585
|
+
cursorColor: "#23ff18",
|
|
2586
|
+
cursorText: "#000000",
|
|
2587
|
+
selectionBackground: "#083905",
|
|
2588
|
+
selectionForeground: "#00ff00"
|
|
2589
|
+
};
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region packages/theme/src/schemes/neon.ts
|
|
2592
|
+
/** Neon — electric high-contrast neon colors. */
|
|
2593
|
+
const neon = {
|
|
2594
|
+
name: "neon",
|
|
2595
|
+
dark: true,
|
|
2596
|
+
black: "#000000",
|
|
2597
|
+
red: "#ff3045",
|
|
2598
|
+
green: "#5ffa74",
|
|
2599
|
+
yellow: "#fffc7e",
|
|
2600
|
+
blue: "#0208cb",
|
|
2601
|
+
magenta: "#f924e7",
|
|
2602
|
+
cyan: "#00fffc",
|
|
2603
|
+
white: "#c7c7c7",
|
|
2604
|
+
brightBlack: "#686868",
|
|
2605
|
+
brightRed: "#ff5a5a",
|
|
2606
|
+
brightGreen: "#75ff88",
|
|
2607
|
+
brightYellow: "#fffd96",
|
|
2608
|
+
brightBlue: "#3c40cb",
|
|
2609
|
+
brightMagenta: "#f15be5",
|
|
2610
|
+
brightCyan: "#88fffe",
|
|
2611
|
+
brightWhite: "#ffffff",
|
|
2612
|
+
foreground: "#00fffc",
|
|
2613
|
+
background: "#14161a",
|
|
2614
|
+
cursorColor: "#c7c7c7",
|
|
2615
|
+
cursorText: "#14161a",
|
|
2616
|
+
selectionBackground: "#0013ff",
|
|
2617
|
+
selectionForeground: "#ffffff"
|
|
2618
|
+
};
|
|
2619
|
+
//#endregion
|
|
2620
|
+
//#region packages/theme/src/schemes/challenger-deep.ts
|
|
2621
|
+
/** Challenger Deep — dreamy purple-blue dark theme. */
|
|
2622
|
+
const challengerDeep = {
|
|
2623
|
+
name: "challenger-deep",
|
|
2624
|
+
dark: true,
|
|
2625
|
+
black: "#141228",
|
|
2626
|
+
red: "#ff5458",
|
|
2627
|
+
green: "#62d196",
|
|
2628
|
+
yellow: "#ffb378",
|
|
2629
|
+
blue: "#65b2ff",
|
|
2630
|
+
magenta: "#906cff",
|
|
2631
|
+
cyan: "#63f2f1",
|
|
2632
|
+
white: "#a6b3cc",
|
|
2633
|
+
brightBlack: "#565575",
|
|
2634
|
+
brightRed: "#ff8080",
|
|
2635
|
+
brightGreen: "#95ffa4",
|
|
2636
|
+
brightYellow: "#ffe9aa",
|
|
2637
|
+
brightBlue: "#91ddff",
|
|
2638
|
+
brightMagenta: "#c991e1",
|
|
2639
|
+
brightCyan: "#aaffe4",
|
|
2640
|
+
brightWhite: "#cbe3e7",
|
|
2641
|
+
foreground: "#cbe1e7",
|
|
2642
|
+
background: "#1e1c31",
|
|
2643
|
+
cursorColor: "#fbfcfc",
|
|
2644
|
+
cursorText: "#1e1c31",
|
|
2645
|
+
selectionBackground: "#cbe1e7",
|
|
2646
|
+
selectionForeground: "#1e1c31"
|
|
2647
|
+
};
|
|
2648
|
+
//#endregion
|
|
2649
|
+
//#region packages/theme/src/schemes/doom-one.ts
|
|
2650
|
+
/** Doom One — Henrik Lissner's Emacs Doom default theme. */
|
|
2651
|
+
const doomOne = {
|
|
2652
|
+
name: "doom-one",
|
|
2653
|
+
dark: true,
|
|
2654
|
+
black: "#000000",
|
|
2655
|
+
red: "#ff6c6b",
|
|
2656
|
+
green: "#98be65",
|
|
2657
|
+
yellow: "#ecbe7b",
|
|
2658
|
+
blue: "#a9a1e1",
|
|
2659
|
+
magenta: "#c678dd",
|
|
2660
|
+
cyan: "#51afef",
|
|
2661
|
+
white: "#bbc2cf",
|
|
2662
|
+
brightBlack: "#000000",
|
|
2663
|
+
brightRed: "#ff6655",
|
|
2664
|
+
brightGreen: "#99bb66",
|
|
2665
|
+
brightYellow: "#ecbe7b",
|
|
2666
|
+
brightBlue: "#a9a1e1",
|
|
2667
|
+
brightMagenta: "#c678dd",
|
|
2668
|
+
brightCyan: "#51afef",
|
|
2669
|
+
brightWhite: "#bfbfbf",
|
|
2670
|
+
foreground: "#bbc2cf",
|
|
2671
|
+
background: "#282c34",
|
|
2672
|
+
cursorColor: "#51afef",
|
|
2673
|
+
cursorText: "#282c34",
|
|
2674
|
+
selectionBackground: "#42444b",
|
|
2675
|
+
selectionForeground: "#bbc2cf"
|
|
2676
|
+
};
|
|
2677
|
+
//#endregion
|
|
2678
|
+
//#region packages/theme/src/schemes/mariana.ts
|
|
2679
|
+
/** Mariana — Sublime Text's oceanic dark theme. */
|
|
2680
|
+
const mariana = {
|
|
2681
|
+
name: "mariana",
|
|
2682
|
+
dark: true,
|
|
2683
|
+
black: "#000000",
|
|
2684
|
+
red: "#ec5f66",
|
|
2685
|
+
green: "#99c794",
|
|
2686
|
+
yellow: "#f9ae58",
|
|
2687
|
+
blue: "#6699cc",
|
|
2688
|
+
magenta: "#c695c6",
|
|
2689
|
+
cyan: "#5fb4b4",
|
|
2690
|
+
white: "#f7f7f7",
|
|
2691
|
+
brightBlack: "#333333",
|
|
2692
|
+
brightRed: "#f97b58",
|
|
2693
|
+
brightGreen: "#acd1a8",
|
|
2694
|
+
brightYellow: "#fac761",
|
|
2695
|
+
brightBlue: "#85add6",
|
|
2696
|
+
brightMagenta: "#d8b6d8",
|
|
2697
|
+
brightCyan: "#82c4c4",
|
|
2698
|
+
brightWhite: "#ffffff",
|
|
2699
|
+
foreground: "#d8dee9",
|
|
2700
|
+
background: "#343d46",
|
|
2701
|
+
cursorColor: "#fcbb6a",
|
|
2702
|
+
cursorText: "#343d46",
|
|
2703
|
+
selectionBackground: "#4e5a65",
|
|
2704
|
+
selectionForeground: "#d8dee9"
|
|
2705
|
+
};
|
|
2706
|
+
//#endregion
|
|
2707
|
+
//#region packages/theme/src/schemes/darcula.ts
|
|
2708
|
+
/** Darcula — the JetBrains IDE dark theme. */
|
|
2709
|
+
const darcula = {
|
|
2710
|
+
name: "darcula",
|
|
2711
|
+
dark: true,
|
|
2712
|
+
black: "#000000",
|
|
2713
|
+
red: "#fa5355",
|
|
2714
|
+
green: "#126e00",
|
|
2715
|
+
yellow: "#c2c300",
|
|
2716
|
+
blue: "#4581eb",
|
|
2717
|
+
magenta: "#fa54ff",
|
|
2718
|
+
cyan: "#33c2c1",
|
|
2719
|
+
white: "#adadad",
|
|
2720
|
+
brightBlack: "#555555",
|
|
2721
|
+
brightRed: "#fb7172",
|
|
2722
|
+
brightGreen: "#67ff4f",
|
|
2723
|
+
brightYellow: "#ffff00",
|
|
2724
|
+
brightBlue: "#6d9df1",
|
|
2725
|
+
brightMagenta: "#fb82ff",
|
|
2726
|
+
brightCyan: "#60d3d1",
|
|
2727
|
+
brightWhite: "#eeeeee",
|
|
2728
|
+
foreground: "#adadad",
|
|
2729
|
+
background: "#202020",
|
|
2730
|
+
cursorColor: "#ffffff",
|
|
2731
|
+
cursorText: "#202020",
|
|
2732
|
+
selectionBackground: "#1a3272",
|
|
2733
|
+
selectionForeground: "#adadad"
|
|
2734
|
+
};
|
|
2735
|
+
//#endregion
|
|
2736
|
+
//#region packages/theme/src/schemes/espresso.ts
|
|
2737
|
+
/** Espresso — warm, balanced dark theme. */
|
|
2738
|
+
const espresso = {
|
|
2739
|
+
name: "espresso",
|
|
2740
|
+
dark: true,
|
|
2741
|
+
black: "#353535",
|
|
2742
|
+
red: "#d25252",
|
|
2743
|
+
green: "#a5c261",
|
|
2744
|
+
yellow: "#ffc66d",
|
|
2745
|
+
blue: "#6c99bb",
|
|
2746
|
+
magenta: "#d197d9",
|
|
2747
|
+
cyan: "#bed6ff",
|
|
2748
|
+
white: "#eeeeec",
|
|
2749
|
+
brightBlack: "#535353",
|
|
2750
|
+
brightRed: "#f00c0c",
|
|
2751
|
+
brightGreen: "#c2e075",
|
|
2752
|
+
brightYellow: "#e1e48b",
|
|
2753
|
+
brightBlue: "#8ab7d9",
|
|
2754
|
+
brightMagenta: "#efb5f7",
|
|
2755
|
+
brightCyan: "#dcf4ff",
|
|
2756
|
+
brightWhite: "#ffffff",
|
|
2757
|
+
foreground: "#ffffff",
|
|
2758
|
+
background: "#323232",
|
|
2759
|
+
cursorColor: "#d6d6d6",
|
|
2760
|
+
cursorText: "#323232",
|
|
2761
|
+
selectionBackground: "#5b5b5b",
|
|
2762
|
+
selectionForeground: "#ffffff"
|
|
2763
|
+
};
|
|
2764
|
+
//#endregion
|
|
2765
|
+
//#region packages/theme/src/schemes/iceberg.ts
|
|
2766
|
+
/** Iceberg Dark — cool blue dark theme. */
|
|
2767
|
+
const icebergDark = {
|
|
2768
|
+
name: "iceberg-dark",
|
|
2769
|
+
dark: true,
|
|
2770
|
+
black: "#1e2132",
|
|
2771
|
+
red: "#e27878",
|
|
2772
|
+
green: "#b4be82",
|
|
2773
|
+
yellow: "#e2a478",
|
|
2774
|
+
blue: "#84a0c6",
|
|
2775
|
+
magenta: "#a093c7",
|
|
2776
|
+
cyan: "#89b8c2",
|
|
2777
|
+
white: "#c6c8d1",
|
|
2778
|
+
brightBlack: "#6b7089",
|
|
2779
|
+
brightRed: "#e98989",
|
|
2780
|
+
brightGreen: "#c0ca8e",
|
|
2781
|
+
brightYellow: "#e9b189",
|
|
2782
|
+
brightBlue: "#91acd1",
|
|
2783
|
+
brightMagenta: "#ada0d3",
|
|
2784
|
+
brightCyan: "#95c4ce",
|
|
2785
|
+
brightWhite: "#d2d4de",
|
|
2786
|
+
foreground: "#c6c8d1",
|
|
2787
|
+
background: "#161821",
|
|
2788
|
+
cursorColor: "#c6c8d1",
|
|
2789
|
+
cursorText: "#161821",
|
|
2790
|
+
selectionBackground: "#c6c8d1",
|
|
2791
|
+
selectionForeground: "#161821"
|
|
2792
|
+
};
|
|
2793
|
+
/** Iceberg Light — cool blue light theme. */
|
|
2794
|
+
const icebergLight = {
|
|
2795
|
+
name: "iceberg-light",
|
|
2796
|
+
dark: false,
|
|
2797
|
+
black: "#dcdfe7",
|
|
2798
|
+
red: "#cc517a",
|
|
2799
|
+
green: "#668e3d",
|
|
2800
|
+
yellow: "#c57339",
|
|
2801
|
+
blue: "#2d539e",
|
|
2802
|
+
magenta: "#7759b4",
|
|
2803
|
+
cyan: "#3f83a6",
|
|
2804
|
+
white: "#33374c",
|
|
2805
|
+
brightBlack: "#8389a3",
|
|
2806
|
+
brightRed: "#cc3768",
|
|
2807
|
+
brightGreen: "#598030",
|
|
2808
|
+
brightYellow: "#b6662d",
|
|
2809
|
+
brightBlue: "#22478e",
|
|
2810
|
+
brightMagenta: "#6845ad",
|
|
2811
|
+
brightCyan: "#327698",
|
|
2812
|
+
brightWhite: "#262a3f",
|
|
2813
|
+
foreground: "#33374c",
|
|
2814
|
+
background: "#e8e9ec",
|
|
2815
|
+
cursorColor: "#33374c",
|
|
2816
|
+
cursorText: "#e8e9ec",
|
|
2817
|
+
selectionBackground: "#33374c",
|
|
2818
|
+
selectionForeground: "#e8e9ec"
|
|
2819
|
+
};
|
|
2820
|
+
//#endregion
|
|
2821
|
+
//#region packages/theme/src/schemes/serendipity.ts
|
|
2822
|
+
/** Serendipity Midnight — deep dark variant. */
|
|
2823
|
+
const serendipityMidnight = {
|
|
2824
|
+
name: "serendipity-midnight",
|
|
2825
|
+
dark: true,
|
|
2826
|
+
black: "#232534",
|
|
2827
|
+
red: "#ee8679",
|
|
2828
|
+
green: "#9ccfd8",
|
|
2829
|
+
yellow: "#f8d2c9",
|
|
2830
|
+
blue: "#5ba2d0",
|
|
2831
|
+
magenta: "#a78bfa",
|
|
2832
|
+
cyan: "#94b8ff",
|
|
2833
|
+
white: "#dee0ef",
|
|
2834
|
+
brightBlack: "#8d8f9e",
|
|
2835
|
+
brightRed: "#ee8679",
|
|
2836
|
+
brightGreen: "#9ccfd8",
|
|
2837
|
+
brightYellow: "#f8d2c9",
|
|
2838
|
+
brightBlue: "#5ba2d0",
|
|
2839
|
+
brightMagenta: "#a78bfa",
|
|
2840
|
+
brightCyan: "#94b8ff",
|
|
2841
|
+
brightWhite: "#dee0ef",
|
|
2842
|
+
foreground: "#dee0ef",
|
|
2843
|
+
background: "#1c1e2d",
|
|
2844
|
+
cursorColor: "#6b6d7c",
|
|
2845
|
+
cursorText: "#1c1e2d",
|
|
2846
|
+
selectionBackground: "#2c2e3d",
|
|
2847
|
+
selectionForeground: "#dee0ef"
|
|
2848
|
+
};
|
|
2849
|
+
/** Serendipity Morning — warm light variant. */
|
|
2850
|
+
const serendipityMorning = {
|
|
2851
|
+
name: "serendipity-morning",
|
|
2852
|
+
dark: false,
|
|
2853
|
+
black: "#f2e9de",
|
|
2854
|
+
red: "#d26a5d",
|
|
2855
|
+
green: "#77aab3",
|
|
2856
|
+
yellow: "#c8a299",
|
|
2857
|
+
blue: "#3788be",
|
|
2858
|
+
magenta: "#886cdb",
|
|
2859
|
+
cyan: "#7397de",
|
|
2860
|
+
white: "#575279",
|
|
2861
|
+
brightBlack: "#6e6a86",
|
|
2862
|
+
brightRed: "#d26a5d",
|
|
2863
|
+
brightGreen: "#77aab3",
|
|
2864
|
+
brightYellow: "#c8a299",
|
|
2865
|
+
brightBlue: "#3788be",
|
|
2866
|
+
brightMagenta: "#886cdb",
|
|
2867
|
+
brightCyan: "#7397de",
|
|
2868
|
+
brightWhite: "#575279",
|
|
2869
|
+
foreground: "#575279",
|
|
2870
|
+
background: "#fffaf3",
|
|
2871
|
+
cursorColor: "#9893a5",
|
|
2872
|
+
cursorText: "#fffaf3",
|
|
2873
|
+
selectionBackground: "#f4efea",
|
|
2874
|
+
selectionForeground: "#575279"
|
|
2875
|
+
};
|
|
2876
|
+
//#endregion
|
|
2877
|
+
//#region packages/theme/src/schemes/twilight.ts
|
|
2878
|
+
/** Twilight — warm earthy dark theme. */
|
|
2879
|
+
const twilight = {
|
|
2880
|
+
name: "twilight",
|
|
2881
|
+
dark: true,
|
|
2882
|
+
black: "#141414",
|
|
2883
|
+
red: "#c06d44",
|
|
2884
|
+
green: "#afb97a",
|
|
2885
|
+
yellow: "#c2a86c",
|
|
2886
|
+
blue: "#44474a",
|
|
2887
|
+
magenta: "#b4be7c",
|
|
2888
|
+
cyan: "#778385",
|
|
2889
|
+
white: "#ffffd4",
|
|
2890
|
+
brightBlack: "#262626",
|
|
2891
|
+
brightRed: "#de7c4c",
|
|
2892
|
+
brightGreen: "#ccd88c",
|
|
2893
|
+
brightYellow: "#e2c47e",
|
|
2894
|
+
brightBlue: "#5a5e62",
|
|
2895
|
+
brightMagenta: "#d0dc8e",
|
|
2896
|
+
brightCyan: "#8a989b",
|
|
2897
|
+
brightWhite: "#ffffd4",
|
|
2898
|
+
foreground: "#ffffd4",
|
|
2899
|
+
background: "#141414",
|
|
2900
|
+
cursorColor: "#ffffff",
|
|
2901
|
+
cursorText: "#141414",
|
|
2902
|
+
selectionBackground: "#313131",
|
|
2903
|
+
selectionForeground: "#ffffd4"
|
|
2904
|
+
};
|
|
2905
|
+
//#endregion
|
|
2906
|
+
//#region packages/theme/src/schemes/breeze.ts
|
|
2907
|
+
/** Breeze — KDE Plasma's clean dark theme. */
|
|
2908
|
+
const breeze = {
|
|
2909
|
+
name: "breeze",
|
|
2910
|
+
dark: true,
|
|
2911
|
+
black: "#31363b",
|
|
2912
|
+
red: "#ed1515",
|
|
2913
|
+
green: "#11d116",
|
|
2914
|
+
yellow: "#f67400",
|
|
2915
|
+
blue: "#1d99f3",
|
|
2916
|
+
magenta: "#9b59b6",
|
|
2917
|
+
cyan: "#1abc9c",
|
|
2918
|
+
white: "#eff0f1",
|
|
2919
|
+
brightBlack: "#7f8c8d",
|
|
2920
|
+
brightRed: "#c0392b",
|
|
2921
|
+
brightGreen: "#1cdc9a",
|
|
2922
|
+
brightYellow: "#fdbc4b",
|
|
2923
|
+
brightBlue: "#3daee9",
|
|
2924
|
+
brightMagenta: "#8e44ad",
|
|
2925
|
+
brightCyan: "#16a085",
|
|
2926
|
+
brightWhite: "#fcfcfc",
|
|
2927
|
+
foreground: "#eff0f1",
|
|
2928
|
+
background: "#31363b",
|
|
2929
|
+
cursorColor: "#eff0f1",
|
|
2930
|
+
cursorText: "#31363b",
|
|
2931
|
+
selectionBackground: "#eff0f1",
|
|
2932
|
+
selectionForeground: "#31363b"
|
|
2933
|
+
};
|
|
2934
|
+
//#endregion
|
|
2935
|
+
//#region packages/theme/src/schemes/andromeda.ts
|
|
2936
|
+
/** Andromeda — rich dark theme with balanced colors. */
|
|
2937
|
+
const andromeda = {
|
|
2938
|
+
name: "andromeda",
|
|
2939
|
+
dark: true,
|
|
2940
|
+
black: "#000000",
|
|
2941
|
+
red: "#cd3131",
|
|
2942
|
+
green: "#05bc79",
|
|
2943
|
+
yellow: "#e5e512",
|
|
2944
|
+
blue: "#2472c8",
|
|
2945
|
+
magenta: "#bc3fbc",
|
|
2946
|
+
cyan: "#0fa8cd",
|
|
2947
|
+
white: "#e5e5e5",
|
|
2948
|
+
brightBlack: "#666666",
|
|
2949
|
+
brightRed: "#cd3131",
|
|
2950
|
+
brightGreen: "#05bc79",
|
|
2951
|
+
brightYellow: "#e5e512",
|
|
2952
|
+
brightBlue: "#2472c8",
|
|
2953
|
+
brightMagenta: "#bc3fbc",
|
|
2954
|
+
brightCyan: "#0fa8cd",
|
|
2955
|
+
brightWhite: "#e5e5e5",
|
|
2956
|
+
foreground: "#e5e5e5",
|
|
2957
|
+
background: "#262a33",
|
|
2958
|
+
cursorColor: "#f8f8f0",
|
|
2959
|
+
cursorText: "#262a33",
|
|
2960
|
+
selectionBackground: "#5a5c62",
|
|
2961
|
+
selectionForeground: "#e5e5e5"
|
|
2962
|
+
};
|
|
2963
|
+
//#endregion
|
|
2964
|
+
//#region packages/theme/src/schemes/relaxed.ts
|
|
2965
|
+
/** Relaxed — low-contrast muted dark theme. */
|
|
2966
|
+
const relaxed = {
|
|
2967
|
+
name: "relaxed",
|
|
2968
|
+
dark: true,
|
|
2969
|
+
black: "#151515",
|
|
2970
|
+
red: "#bc5653",
|
|
2971
|
+
green: "#909d63",
|
|
2972
|
+
yellow: "#ebc17a",
|
|
2973
|
+
blue: "#6a8799",
|
|
2974
|
+
magenta: "#b06698",
|
|
2975
|
+
cyan: "#c9dfff",
|
|
2976
|
+
white: "#d9d9d9",
|
|
2977
|
+
brightBlack: "#636363",
|
|
2978
|
+
brightRed: "#bc5653",
|
|
2979
|
+
brightGreen: "#a0ac77",
|
|
2980
|
+
brightYellow: "#ebc17a",
|
|
2981
|
+
brightBlue: "#7eaac7",
|
|
2982
|
+
brightMagenta: "#b06698",
|
|
2983
|
+
brightCyan: "#acbbd0",
|
|
2984
|
+
brightWhite: "#f7f7f7",
|
|
2985
|
+
foreground: "#d9d9d9",
|
|
2986
|
+
background: "#353a44",
|
|
2987
|
+
cursorColor: "#d9d9d9",
|
|
2988
|
+
cursorText: "#353a44",
|
|
2989
|
+
selectionBackground: "#6a7985",
|
|
2990
|
+
selectionForeground: "#d9d9d9"
|
|
2991
|
+
};
|
|
2992
|
+
//#endregion
|
|
2993
|
+
//#region packages/theme/src/schemes/silvery.ts
|
|
2994
|
+
/** Silvery Dark — the flagship dark scheme. Cool, low-saturation, silver accent. */
|
|
2995
|
+
const silveryDark = {
|
|
2996
|
+
name: "silvery-dark",
|
|
2997
|
+
dark: true,
|
|
2998
|
+
primary: "#9FB7C9",
|
|
2999
|
+
black: "#1A1D23",
|
|
3000
|
+
red: "#D28078",
|
|
3001
|
+
green: "#9FB8A3",
|
|
3002
|
+
yellow: "#C79A58",
|
|
3003
|
+
blue: "#7A9BC0",
|
|
3004
|
+
magenta: "#B498BD",
|
|
3005
|
+
cyan: "#88B8C0",
|
|
3006
|
+
white: "#B8BEC9",
|
|
3007
|
+
brightBlack: "#3A3F4A",
|
|
3008
|
+
brightRed: "#E09389",
|
|
3009
|
+
brightGreen: "#B5CCB9",
|
|
3010
|
+
brightYellow: "#D8B074",
|
|
3011
|
+
brightBlue: "#9FB7C9",
|
|
3012
|
+
brightMagenta: "#CCB3D4",
|
|
3013
|
+
brightCyan: "#A0CBD4",
|
|
3014
|
+
brightWhite: "#E4E8EF",
|
|
3015
|
+
foreground: "#D8DCE3",
|
|
3016
|
+
background: "#1E2128",
|
|
3017
|
+
cursorColor: "#9FB7C9",
|
|
3018
|
+
cursorText: "#1E2128",
|
|
3019
|
+
selectionBackground: "#3A4350",
|
|
3020
|
+
selectionForeground: "#E4E8EF"
|
|
3021
|
+
};
|
|
3022
|
+
/** Silvery Light — companion light scheme. High legibility, subtle tint. */
|
|
3023
|
+
const silveryLight = {
|
|
3024
|
+
name: "silvery-light",
|
|
3025
|
+
dark: false,
|
|
3026
|
+
primary: "#4A6580",
|
|
3027
|
+
black: "#2C3038",
|
|
3028
|
+
red: "#B4614A",
|
|
3029
|
+
green: "#5C7D60",
|
|
3030
|
+
yellow: "#9A7030",
|
|
3031
|
+
blue: "#4A6B94",
|
|
3032
|
+
magenta: "#845D92",
|
|
3033
|
+
cyan: "#4A8894",
|
|
3034
|
+
white: "#6A7080",
|
|
3035
|
+
brightBlack: "#454A55",
|
|
3036
|
+
brightRed: "#C07760",
|
|
3037
|
+
brightGreen: "#759378",
|
|
3038
|
+
brightYellow: "#B48845",
|
|
3039
|
+
brightBlue: "#5F7FA4",
|
|
3040
|
+
brightMagenta: "#96759E",
|
|
3041
|
+
brightCyan: "#5F9CA4",
|
|
3042
|
+
brightWhite: "#2C3038",
|
|
3043
|
+
foreground: "#2C3038",
|
|
3044
|
+
background: "#F5F6F8",
|
|
3045
|
+
cursorColor: "#4A6580",
|
|
3046
|
+
cursorText: "#F5F6F8",
|
|
3047
|
+
selectionBackground: "#D8DCE3",
|
|
3048
|
+
selectionForeground: "#2C3038"
|
|
3049
|
+
};
|
|
3050
|
+
//#endregion
|
|
3051
|
+
//#region packages/theme/src/schemes/classics.ts
|
|
3052
|
+
/** Classic IBM VGA 16-color palette (circa 1987). The OG 16 colors. */
|
|
3053
|
+
const vga = {
|
|
3054
|
+
name: "vga",
|
|
3055
|
+
dark: true,
|
|
3056
|
+
black: "#000000",
|
|
3057
|
+
red: "#AA0000",
|
|
3058
|
+
green: "#00AA00",
|
|
3059
|
+
yellow: "#AA5500",
|
|
3060
|
+
blue: "#0000AA",
|
|
3061
|
+
magenta: "#AA00AA",
|
|
3062
|
+
cyan: "#00AAAA",
|
|
3063
|
+
white: "#AAAAAA",
|
|
3064
|
+
brightBlack: "#555555",
|
|
3065
|
+
brightRed: "#FF5555",
|
|
3066
|
+
brightGreen: "#55FF55",
|
|
3067
|
+
brightYellow: "#FFFF55",
|
|
3068
|
+
brightBlue: "#5555FF",
|
|
3069
|
+
brightMagenta: "#FF55FF",
|
|
3070
|
+
brightCyan: "#55FFFF",
|
|
3071
|
+
brightWhite: "#FFFFFF",
|
|
3072
|
+
foreground: "#AAAAAA",
|
|
3073
|
+
background: "#000000",
|
|
3074
|
+
cursorColor: "#FFFFFF",
|
|
3075
|
+
cursorText: "#000000",
|
|
3076
|
+
selectionBackground: "#888888",
|
|
3077
|
+
selectionForeground: "#000000"
|
|
3078
|
+
};
|
|
3079
|
+
/** xterm's default palette (X Consortium). The reference terminal defaults. */
|
|
3080
|
+
const xtermDefault = {
|
|
3081
|
+
name: "xterm-default",
|
|
3082
|
+
dark: true,
|
|
3083
|
+
black: "#000000",
|
|
3084
|
+
red: "#CD0000",
|
|
3085
|
+
green: "#00CD00",
|
|
3086
|
+
yellow: "#CDCD00",
|
|
3087
|
+
blue: "#0000EE",
|
|
3088
|
+
magenta: "#CD00CD",
|
|
3089
|
+
cyan: "#00CDCD",
|
|
3090
|
+
white: "#E5E5E5",
|
|
3091
|
+
brightBlack: "#7F7F7F",
|
|
3092
|
+
brightRed: "#FF0000",
|
|
3093
|
+
brightGreen: "#00FF00",
|
|
3094
|
+
brightYellow: "#FFFF00",
|
|
3095
|
+
brightBlue: "#5C5CFF",
|
|
3096
|
+
brightMagenta: "#FF00FF",
|
|
3097
|
+
brightCyan: "#00FFFF",
|
|
3098
|
+
brightWhite: "#FFFFFF",
|
|
3099
|
+
foreground: "#E5E5E5",
|
|
3100
|
+
background: "#000000",
|
|
3101
|
+
cursorColor: "#E5E5E5",
|
|
3102
|
+
cursorText: "#000000",
|
|
3103
|
+
selectionBackground: "#555555",
|
|
3104
|
+
selectionForeground: "#E5E5E5"
|
|
3105
|
+
};
|
|
3106
|
+
/** Apple Terminal.app "Basic" profile. */
|
|
3107
|
+
const appleTerminalBasic = {
|
|
3108
|
+
name: "apple-terminal-basic",
|
|
3109
|
+
dark: false,
|
|
3110
|
+
black: "#000000",
|
|
3111
|
+
red: "#990000",
|
|
3112
|
+
green: "#00A600",
|
|
3113
|
+
yellow: "#999900",
|
|
3114
|
+
blue: "#0000B2",
|
|
3115
|
+
magenta: "#B200B2",
|
|
3116
|
+
cyan: "#00A6B2",
|
|
3117
|
+
white: "#BFBFBF",
|
|
3118
|
+
brightBlack: "#666666",
|
|
3119
|
+
brightRed: "#E50000",
|
|
3120
|
+
brightGreen: "#00D900",
|
|
3121
|
+
brightYellow: "#E5E500",
|
|
3122
|
+
brightBlue: "#0000FF",
|
|
3123
|
+
brightMagenta: "#E500E5",
|
|
3124
|
+
brightCyan: "#00E5E5",
|
|
3125
|
+
brightWhite: "#E5E5E5",
|
|
3126
|
+
foreground: "#000000",
|
|
3127
|
+
background: "#FFFFFF",
|
|
3128
|
+
cursorColor: "#000000",
|
|
3129
|
+
cursorText: "#FFFFFF",
|
|
3130
|
+
selectionBackground: "#B5D5FF",
|
|
3131
|
+
selectionForeground: "#000000"
|
|
3132
|
+
};
|
|
3133
|
+
/** Windows Terminal (Campbell scheme — the default profile on Windows 10/11). */
|
|
3134
|
+
const windowsTerminalCampbell = {
|
|
3135
|
+
name: "windows-terminal-campbell",
|
|
3136
|
+
dark: true,
|
|
3137
|
+
black: "#0C0C0C",
|
|
3138
|
+
red: "#C50F1F",
|
|
3139
|
+
green: "#13A10E",
|
|
3140
|
+
yellow: "#C19C00",
|
|
3141
|
+
blue: "#0037DA",
|
|
3142
|
+
magenta: "#881798",
|
|
3143
|
+
cyan: "#3A96DD",
|
|
3144
|
+
white: "#CCCCCC",
|
|
3145
|
+
brightBlack: "#767676",
|
|
3146
|
+
brightRed: "#E74856",
|
|
3147
|
+
brightGreen: "#16C60C",
|
|
3148
|
+
brightYellow: "#F9F1A5",
|
|
3149
|
+
brightBlue: "#3B78FF",
|
|
3150
|
+
brightMagenta: "#B4009E",
|
|
3151
|
+
brightCyan: "#61D6D6",
|
|
3152
|
+
brightWhite: "#F2F2F2",
|
|
3153
|
+
foreground: "#CCCCCC",
|
|
3154
|
+
background: "#0C0C0C",
|
|
3155
|
+
cursorColor: "#FFFFFF",
|
|
3156
|
+
cursorText: "#0C0C0C",
|
|
3157
|
+
selectionBackground: "#FFFFFF",
|
|
3158
|
+
selectionForeground: "#0C0C0C"
|
|
3159
|
+
};
|
|
3160
|
+
/** GNOME Terminal (Tango variant — the default on many Linux distros). */
|
|
3161
|
+
const gnomeTerminalTango = {
|
|
3162
|
+
name: "gnome-terminal-tango",
|
|
3163
|
+
dark: true,
|
|
3164
|
+
black: "#2E3436",
|
|
3165
|
+
red: "#CC0000",
|
|
3166
|
+
green: "#4E9A06",
|
|
3167
|
+
yellow: "#C4A000",
|
|
3168
|
+
blue: "#3465A4",
|
|
3169
|
+
magenta: "#75507B",
|
|
3170
|
+
cyan: "#06989A",
|
|
3171
|
+
white: "#D3D7CF",
|
|
3172
|
+
brightBlack: "#555753",
|
|
3173
|
+
brightRed: "#EF2929",
|
|
3174
|
+
brightGreen: "#8AE234",
|
|
3175
|
+
brightYellow: "#FCE94F",
|
|
3176
|
+
brightBlue: "#729FCF",
|
|
3177
|
+
brightMagenta: "#AD7FA8",
|
|
3178
|
+
brightCyan: "#34E2E2",
|
|
3179
|
+
brightWhite: "#EEEEEC",
|
|
3180
|
+
foreground: "#D3D7CF",
|
|
3181
|
+
background: "#300A24",
|
|
3182
|
+
cursorColor: "#D3D7CF",
|
|
3183
|
+
cursorText: "#300A24",
|
|
3184
|
+
selectionBackground: "#555753",
|
|
3185
|
+
selectionForeground: "#D3D7CF"
|
|
3186
|
+
};
|
|
3187
|
+
//#endregion
|
|
3188
|
+
//#region packages/theme/src/schemes/index.ts
|
|
3189
|
+
init_src();
|
|
3190
|
+
/**
|
|
3191
|
+
* Dark ANSI 16 theme — hex-valued, derived from the default dark scheme.
|
|
3192
|
+
* All token values are hex strings (no ANSI slot names).
|
|
3193
|
+
* Terminal rendering quantizes hex to 4-bit ANSI codes when colorLevel === "basic".
|
|
3194
|
+
*
|
|
3195
|
+
* Sterling flat tokens (`bg-surface-subtle`, `fg-on-accent`, `border-focus`, …)
|
|
3196
|
+
* are baked in at construction — consumers can read either legacy fields or
|
|
3197
|
+
* Sterling flat keys off the same Theme object.
|
|
3198
|
+
*/
|
|
3199
|
+
const ansi16DarkTheme = inlineSterlingTokens(ansi16DarkTheme$1);
|
|
3200
|
+
/**
|
|
3201
|
+
* Light ANSI 16 theme — hex-valued, derived from the default light scheme.
|
|
3202
|
+
* All token values are hex strings (no ANSI slot names).
|
|
3203
|
+
* Terminal rendering quantizes hex to 4-bit ANSI codes when colorLevel === "basic".
|
|
3204
|
+
*
|
|
3205
|
+
* Sterling flat tokens baked in at construction.
|
|
3206
|
+
*/
|
|
3207
|
+
const ansi16LightTheme = inlineSterlingTokens(ansi16LightTheme$1);
|
|
3208
|
+
/** Dark truecolor theme — derived from Nord. Sterling flat tokens baked in. */
|
|
3209
|
+
const defaultDarkTheme = inlineSterlingTokens(deriveTheme$1(nord), nord);
|
|
3210
|
+
/** Light truecolor theme — derived from Catppuccin Latte. Sterling flat tokens baked in. */
|
|
3211
|
+
const defaultLightTheme = inlineSterlingTokens(deriveTheme$1(catppuccinLatte), catppuccinLatte);
|
|
3212
|
+
/** All built-in ColorScheme definitions (70+ palettes). */
|
|
3213
|
+
const builtinPalettes = {
|
|
3214
|
+
"catppuccin-mocha": catppuccinMocha,
|
|
3215
|
+
"catppuccin-frappe": catppuccinFrappe,
|
|
3216
|
+
"catppuccin-macchiato": catppuccinMacchiato,
|
|
3217
|
+
"catppuccin-latte": catppuccinLatte,
|
|
3218
|
+
nord,
|
|
3219
|
+
dracula,
|
|
3220
|
+
"solarized-dark": solarizedDark,
|
|
3221
|
+
"solarized-light": solarizedLight,
|
|
3222
|
+
"tokyo-night": tokyoNight,
|
|
3223
|
+
"tokyo-night-storm": tokyoNightStorm,
|
|
3224
|
+
"tokyo-night-day": tokyoNightDay,
|
|
3225
|
+
"one-dark": oneDark,
|
|
3226
|
+
"gruvbox-dark": gruvboxDark,
|
|
3227
|
+
"gruvbox-light": gruvboxLight,
|
|
3228
|
+
"rose-pine": rosePine,
|
|
3229
|
+
"rose-pine-moon": rosePineMoon,
|
|
3230
|
+
"rose-pine-dawn": rosePineDawn,
|
|
3231
|
+
"kanagawa-wave": kanagawaWave,
|
|
3232
|
+
"kanagawa-dragon": kanagawaDragon,
|
|
3233
|
+
"kanagawa-lotus": kanagawaLotus,
|
|
3234
|
+
"everforest-dark": everforestDark,
|
|
3235
|
+
"everforest-light": everforestLight,
|
|
3236
|
+
monokai,
|
|
3237
|
+
"monokai-pro": monokaiPro,
|
|
3238
|
+
snazzy,
|
|
3239
|
+
"material-dark": materialDark,
|
|
3240
|
+
"material-light": materialLight,
|
|
3241
|
+
palenight,
|
|
3242
|
+
"ayu-dark": ayuDark,
|
|
3243
|
+
"ayu-mirage": ayuMirage,
|
|
3244
|
+
"ayu-light": ayuLight,
|
|
3245
|
+
nightfox,
|
|
3246
|
+
dawnfox,
|
|
3247
|
+
horizon,
|
|
3248
|
+
moonfly,
|
|
3249
|
+
nightfly,
|
|
3250
|
+
"oxocarbon-dark": oxocarbonDark,
|
|
3251
|
+
"oxocarbon-light": oxocarbonLight,
|
|
3252
|
+
sonokai,
|
|
3253
|
+
"edge-dark": edgeDark,
|
|
3254
|
+
"edge-light": edgeLight,
|
|
3255
|
+
"modus-vivendi": modusVivendi,
|
|
3256
|
+
"modus-operandi": modusOperandi,
|
|
3257
|
+
"github-dark": githubDark,
|
|
3258
|
+
"github-light": githubLight,
|
|
3259
|
+
cobalt2,
|
|
3260
|
+
synthwave,
|
|
3261
|
+
"synthwave-84": synthwave84,
|
|
3262
|
+
"tomorrow-night": tomorrowNight,
|
|
3263
|
+
"tomorrow-night-blue": tomorrowNightBlue,
|
|
3264
|
+
"tomorrow-night-eighties": tomorrowNightEighties,
|
|
3265
|
+
zenburn,
|
|
3266
|
+
ubuntu,
|
|
3267
|
+
"tango-dark": tangoDark,
|
|
3268
|
+
"tango-light": tangoLight,
|
|
3269
|
+
cyberpunk,
|
|
3270
|
+
"vscode-dark": vscodeDark,
|
|
3271
|
+
"one-light": oneLight,
|
|
3272
|
+
"one-half-dark": oneHalfDark,
|
|
3273
|
+
"one-half-light": oneHalfLight,
|
|
3274
|
+
"night-owl-light": nightOwlLight,
|
|
3275
|
+
"shades-of-purple": shadesOfPurple,
|
|
3276
|
+
homebrew,
|
|
3277
|
+
neon,
|
|
3278
|
+
"challenger-deep": challengerDeep,
|
|
3279
|
+
"doom-one": doomOne,
|
|
3280
|
+
mariana,
|
|
3281
|
+
darcula,
|
|
3282
|
+
espresso,
|
|
3283
|
+
"iceberg-dark": icebergDark,
|
|
3284
|
+
"iceberg-light": icebergLight,
|
|
3285
|
+
"serendipity-midnight": serendipityMidnight,
|
|
3286
|
+
"serendipity-morning": serendipityMorning,
|
|
3287
|
+
twilight,
|
|
3288
|
+
breeze,
|
|
3289
|
+
andromeda,
|
|
3290
|
+
relaxed,
|
|
3291
|
+
"silvery-dark": silveryDark,
|
|
3292
|
+
"silvery-light": silveryLight,
|
|
3293
|
+
vga,
|
|
3294
|
+
"xterm-default": xtermDefault,
|
|
3295
|
+
"apple-terminal-basic": appleTerminalBasic,
|
|
3296
|
+
"windows-terminal-campbell": windowsTerminalCampbell,
|
|
3297
|
+
"gnome-terminal-tango": gnomeTerminalTango
|
|
3298
|
+
};
|
|
3299
|
+
/** All built-in themes, indexed by name (includes backward-compat aliases). */
|
|
3300
|
+
const builtinThemes = {
|
|
3301
|
+
"dark-ansi16": ansi16DarkTheme,
|
|
3302
|
+
"light-ansi16": ansi16LightTheme,
|
|
3303
|
+
"dark-truecolor": defaultDarkTheme,
|
|
3304
|
+
"light-truecolor": defaultLightTheme,
|
|
3305
|
+
dark: defaultDarkTheme,
|
|
3306
|
+
light: defaultLightTheme,
|
|
3307
|
+
"ansi16-dark": ansi16DarkTheme,
|
|
3308
|
+
"ansi16-light": ansi16LightTheme
|
|
3309
|
+
};
|
|
3310
|
+
/** Resolve a theme by name. Defaults to dark-ansi16. */
|
|
3311
|
+
function getThemeByName(name) {
|
|
3312
|
+
if (!name) return ansi16DarkTheme;
|
|
3313
|
+
const builtin = builtinThemes[name];
|
|
3314
|
+
if (builtin) return builtin;
|
|
3315
|
+
const palette = builtinPalettes[name];
|
|
3316
|
+
if (palette) return inlineSterlingTokens(deriveTheme$1(palette), palette);
|
|
3317
|
+
return ansi16DarkTheme;
|
|
3318
|
+
}
|
|
3319
|
+
/** Resolve a palette by name. Returns undefined if not found. */
|
|
3320
|
+
function getSchemeByName(name) {
|
|
3321
|
+
return builtinPalettes[name];
|
|
3322
|
+
}
|
|
3323
|
+
//#endregion
|
|
3324
|
+
//#region packages/theme/src/generators.ts
|
|
3325
|
+
/**
|
|
3326
|
+
* Palette generators — produce a ColorScheme from various inputs.
|
|
3327
|
+
*
|
|
3328
|
+
* All generators return a complete ColorScheme (22 fields).
|
|
3329
|
+
*/
|
|
3330
|
+
function isDarkColor$1(hex) {
|
|
3331
|
+
const L = relativeLuminance(hex);
|
|
3332
|
+
return L === null ? true : L < .5;
|
|
3333
|
+
}
|
|
3334
|
+
/**
|
|
3335
|
+
* Target hues for each accent slot, in OKLCH degrees.
|
|
3336
|
+
* OKLCH hues differ from HSL — red ≈ 29, green ≈ 142, blue ≈ 264. Calibrated
|
|
3337
|
+
* per Ottosson's reference ramps for perceptually-uniform accent generation.
|
|
3338
|
+
*/
|
|
3339
|
+
const targetHues = {
|
|
3340
|
+
red: 29,
|
|
3341
|
+
orange: 55,
|
|
3342
|
+
yellow: 90,
|
|
3343
|
+
green: 142,
|
|
3344
|
+
teal: 195,
|
|
3345
|
+
blue: 240,
|
|
3346
|
+
purple: 305,
|
|
3347
|
+
pink: 350
|
|
3348
|
+
};
|
|
3349
|
+
/** Find which hue slot the primary color best matches by OKLCH hue angle proximity. */
|
|
3350
|
+
function assignPrimaryToSlot(primary) {
|
|
3351
|
+
const o = hexToOklch(primary);
|
|
3352
|
+
if (!o) return "blue";
|
|
3353
|
+
const h = o.H;
|
|
3354
|
+
for (const [lo, hi, name] of [
|
|
3355
|
+
[
|
|
3356
|
+
0,
|
|
3357
|
+
15,
|
|
3358
|
+
"red"
|
|
3359
|
+
],
|
|
3360
|
+
[
|
|
3361
|
+
15,
|
|
3362
|
+
42,
|
|
3363
|
+
"orange"
|
|
3364
|
+
],
|
|
3365
|
+
[
|
|
3366
|
+
42,
|
|
3367
|
+
75,
|
|
3368
|
+
"yellow"
|
|
3369
|
+
],
|
|
3370
|
+
[
|
|
3371
|
+
75,
|
|
3372
|
+
170,
|
|
3373
|
+
"green"
|
|
3374
|
+
],
|
|
3375
|
+
[
|
|
3376
|
+
170,
|
|
3377
|
+
210,
|
|
3378
|
+
"teal"
|
|
3379
|
+
],
|
|
3380
|
+
[
|
|
3381
|
+
210,
|
|
3382
|
+
275,
|
|
3383
|
+
"blue"
|
|
3384
|
+
],
|
|
3385
|
+
[
|
|
3386
|
+
275,
|
|
3387
|
+
330,
|
|
3388
|
+
"purple"
|
|
3389
|
+
],
|
|
3390
|
+
[
|
|
3391
|
+
330,
|
|
3392
|
+
360,
|
|
3393
|
+
"pink"
|
|
3394
|
+
]
|
|
3395
|
+
]) if (h >= lo && h < hi) return name;
|
|
3396
|
+
return "red";
|
|
3397
|
+
}
|
|
3398
|
+
/** Generate 8 accent hues from a primary, placing it in its natural slot. */
|
|
3399
|
+
function generateAccentsFromPrimary(primary) {
|
|
3400
|
+
const o = hexToOklch(primary);
|
|
3401
|
+
if (!o) return {
|
|
3402
|
+
red: "#BF616A",
|
|
3403
|
+
orange: "#D08770",
|
|
3404
|
+
yellow: "#EBCB8B",
|
|
3405
|
+
green: "#A3BE8C",
|
|
3406
|
+
teal: "#88C0D0",
|
|
3407
|
+
blue: "#5E81AC",
|
|
3408
|
+
purple: "#B48EAD",
|
|
3409
|
+
pink: "#D4879C"
|
|
3410
|
+
};
|
|
3411
|
+
const slot = assignPrimaryToSlot(primary);
|
|
3412
|
+
const result = {};
|
|
3413
|
+
for (const [name, targetH] of Object.entries(targetHues)) result[name] = name === slot ? primary : oklchToHex({
|
|
3414
|
+
L: o.L,
|
|
3415
|
+
C: o.C,
|
|
3416
|
+
H: targetH
|
|
3417
|
+
});
|
|
3418
|
+
return result;
|
|
3419
|
+
}
|
|
3420
|
+
/**
|
|
3421
|
+
* Generate a ColorScheme from a Base16 YAML scheme.
|
|
3422
|
+
*
|
|
3423
|
+
* Maps base00–base0F to ANSI palette colors, derives special colors.
|
|
3424
|
+
*/
|
|
3425
|
+
function fromBase16(yamlOrJson) {
|
|
3426
|
+
return importBase16(yamlOrJson);
|
|
3427
|
+
}
|
|
3428
|
+
/**
|
|
3429
|
+
* Generate a full ColorScheme from 1-3 hex colors.
|
|
3430
|
+
*
|
|
3431
|
+
* At minimum, provide `background` or `primary`. Missing colors are
|
|
3432
|
+
* generated via surface ramp (from bg) and hue rotation (from primary).
|
|
3433
|
+
*/
|
|
3434
|
+
function fromColors(opts) {
|
|
3435
|
+
const dark = opts.dark ?? (opts.background ? isDarkColor$1(opts.background) : true);
|
|
3436
|
+
const step = dark ? brighten : darken;
|
|
3437
|
+
const bg = opts.background ?? (dark ? "#2E3440" : "#FFFFFF");
|
|
3438
|
+
const fg = opts.foreground ?? step(bg, .85);
|
|
3439
|
+
const accents = opts.primary ? generateAccentsFromPrimary(opts.primary) : {
|
|
3440
|
+
red: "#BF616A",
|
|
3441
|
+
orange: "#D08770",
|
|
3442
|
+
yellow: "#EBCB8B",
|
|
3443
|
+
green: "#A3BE8C",
|
|
3444
|
+
teal: "#88C0D0",
|
|
3445
|
+
blue: "#5E81AC",
|
|
3446
|
+
purple: "#B48EAD",
|
|
3447
|
+
pink: "#D4879C"
|
|
3448
|
+
};
|
|
3449
|
+
const black = dark ? darken(bg, .05) : darken(bg, .1);
|
|
3450
|
+
const white = dark ? blend(fg, bg, .3) : blend(bg, fg, .3);
|
|
3451
|
+
const brightBlack = step(bg, .15);
|
|
3452
|
+
const brightWhite = dark ? fg : brighten(fg, .1);
|
|
3453
|
+
return {
|
|
3454
|
+
name: opts.name ?? (dark ? "generated-dark" : "generated-light"),
|
|
3455
|
+
dark,
|
|
3456
|
+
primary: opts.primary,
|
|
3457
|
+
black,
|
|
3458
|
+
red: accents.red,
|
|
3459
|
+
green: accents.green,
|
|
3460
|
+
yellow: accents.yellow,
|
|
3461
|
+
blue: accents.blue,
|
|
3462
|
+
magenta: accents.purple,
|
|
3463
|
+
cyan: accents.teal,
|
|
3464
|
+
white,
|
|
3465
|
+
brightBlack,
|
|
3466
|
+
brightRed: accents.orange,
|
|
3467
|
+
brightGreen: brighten(accents.green, .15),
|
|
3468
|
+
brightYellow: brighten(accents.yellow, .15),
|
|
3469
|
+
brightBlue: brighten(accents.blue, .15),
|
|
3470
|
+
brightMagenta: accents.pink,
|
|
3471
|
+
brightCyan: brighten(accents.teal, .15),
|
|
3472
|
+
brightWhite,
|
|
3473
|
+
foreground: fg,
|
|
3474
|
+
background: bg,
|
|
3475
|
+
cursorColor: fg,
|
|
3476
|
+
cursorText: bg,
|
|
3477
|
+
selectionBackground: blend(bg, accents.blue, .3),
|
|
3478
|
+
selectionForeground: fg
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3481
|
+
/**
|
|
3482
|
+
* Look up a built-in palette by name.
|
|
3483
|
+
*
|
|
3484
|
+
* @returns The ColorScheme, or undefined if not found.
|
|
3485
|
+
*/
|
|
3486
|
+
function fromPreset(name) {
|
|
3487
|
+
return getSchemeByName(name);
|
|
3488
|
+
}
|
|
3489
|
+
//#endregion
|
|
3490
|
+
//#region packages/theme/src/builder.ts
|
|
3491
|
+
/**
|
|
3492
|
+
* Chainable theme builder — create themes from minimal input.
|
|
3493
|
+
*
|
|
3494
|
+
* @example
|
|
3495
|
+
* ```typescript
|
|
3496
|
+
* // Just a background color
|
|
3497
|
+
* const theme = createTheme().bg('#2E3440').build()
|
|
3498
|
+
*
|
|
3499
|
+
* // Primary + explicit dark mode
|
|
3500
|
+
* const theme = createTheme().primary('#EBCB8B').dark().build()
|
|
3501
|
+
*
|
|
3502
|
+
* // Three-color input (dark/light inferred from bg luminance)
|
|
3503
|
+
* const theme = createTheme()
|
|
3504
|
+
* .bg('#2E3440').fg('#ECEFF4').primary('#EBCB8B').build()
|
|
3505
|
+
*
|
|
3506
|
+
* // Preset with override
|
|
3507
|
+
* const theme = createTheme().preset('nord').primary('#A3BE8C').build()
|
|
3508
|
+
* ```
|
|
3509
|
+
*/
|
|
3510
|
+
init_src();
|
|
3511
|
+
function isDarkColor(hex) {
|
|
3512
|
+
const rgb = hexToRgb(hex);
|
|
3513
|
+
if (!rgb) return true;
|
|
3514
|
+
return (rgb[0] + rgb[1] + rgb[2]) / 765 < .5;
|
|
3515
|
+
}
|
|
3516
|
+
/** Create a chainable theme builder. */
|
|
3517
|
+
function createTheme() {
|
|
3518
|
+
const state = { colors: {} };
|
|
3519
|
+
const builder = {
|
|
3520
|
+
bg(color) {
|
|
3521
|
+
state.bgColor = color;
|
|
3522
|
+
return builder;
|
|
3523
|
+
},
|
|
3524
|
+
fg(color) {
|
|
3525
|
+
state.fgColor = color;
|
|
3526
|
+
return builder;
|
|
3527
|
+
},
|
|
3528
|
+
primary(color) {
|
|
3529
|
+
state.primaryColor = color;
|
|
3530
|
+
return builder;
|
|
3531
|
+
},
|
|
3532
|
+
accent(color) {
|
|
3533
|
+
return builder.primary(color);
|
|
3534
|
+
},
|
|
3535
|
+
dark() {
|
|
3536
|
+
state.dark = true;
|
|
3537
|
+
return builder;
|
|
3538
|
+
},
|
|
3539
|
+
light() {
|
|
3540
|
+
state.dark = false;
|
|
3541
|
+
return builder;
|
|
3542
|
+
},
|
|
3543
|
+
color(name, value) {
|
|
3544
|
+
state.colors[name] = value;
|
|
3545
|
+
return builder;
|
|
3546
|
+
},
|
|
3547
|
+
palette(p) {
|
|
3548
|
+
state.presetPalette = p;
|
|
3549
|
+
return builder;
|
|
3550
|
+
},
|
|
3551
|
+
preset(name) {
|
|
3552
|
+
const p = getSchemeByName(name);
|
|
3553
|
+
if (p) state.presetPalette = p;
|
|
3554
|
+
return builder;
|
|
3555
|
+
},
|
|
3556
|
+
build() {
|
|
3557
|
+
const isDark = state.dark ?? (state.bgColor ? isDarkColor(state.bgColor) : true);
|
|
3558
|
+
let palette;
|
|
3559
|
+
if (state.presetPalette) {
|
|
3560
|
+
palette = { ...state.presetPalette };
|
|
3561
|
+
if (state.bgColor) palette.background = state.bgColor;
|
|
3562
|
+
if (state.fgColor) palette.foreground = state.fgColor;
|
|
3563
|
+
if (state.primaryColor) {
|
|
3564
|
+
palette.primary = state.primaryColor;
|
|
3565
|
+
const ansiName = hueToAnsiField(assignPrimaryToSlot(state.primaryColor));
|
|
3566
|
+
palette[ansiName] = state.primaryColor;
|
|
3567
|
+
}
|
|
3568
|
+
palette.dark = isDark;
|
|
3569
|
+
} else palette = fromColors({
|
|
3570
|
+
background: state.bgColor,
|
|
3571
|
+
foreground: state.fgColor,
|
|
3572
|
+
primary: state.primaryColor,
|
|
3573
|
+
dark: isDark
|
|
3574
|
+
});
|
|
3575
|
+
for (const [key, val] of Object.entries(state.colors)) if (val !== void 0 && typeof val === "string") palette[key] = val;
|
|
3576
|
+
return deriveTheme$1(palette);
|
|
3577
|
+
}
|
|
3578
|
+
};
|
|
3579
|
+
return builder;
|
|
3580
|
+
}
|
|
3581
|
+
/** Map a HueName to the corresponding ColorScheme field. */
|
|
3582
|
+
function hueToAnsiField(hue) {
|
|
3583
|
+
return {
|
|
3584
|
+
red: "red",
|
|
3585
|
+
orange: "brightRed",
|
|
3586
|
+
yellow: "yellow",
|
|
3587
|
+
green: "green",
|
|
3588
|
+
teal: "cyan",
|
|
3589
|
+
blue: "blue",
|
|
3590
|
+
purple: "magenta",
|
|
3591
|
+
pink: "brightMagenta"
|
|
3592
|
+
}[hue];
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Quick theme from a primary color or color name.
|
|
3596
|
+
*
|
|
3597
|
+
* @example
|
|
3598
|
+
* ```typescript
|
|
3599
|
+
* quickTheme('#EBCB8B', 'dark') // yellow primary, dark mode
|
|
3600
|
+
* quickTheme('blue') // blue primary, default dark
|
|
3601
|
+
* ```
|
|
3602
|
+
*/
|
|
3603
|
+
function quickTheme(primaryOrHex, mode) {
|
|
3604
|
+
const b = createTheme();
|
|
3605
|
+
if (primaryOrHex.startsWith("#")) b.primary(primaryOrHex);
|
|
3606
|
+
else b.primary({
|
|
3607
|
+
red: "#BF616A",
|
|
3608
|
+
orange: "#D08770",
|
|
3609
|
+
yellow: "#EBCB8B",
|
|
3610
|
+
green: "#A3BE8C",
|
|
3611
|
+
teal: "#88C0D0",
|
|
3612
|
+
cyan: "#88C0D0",
|
|
3613
|
+
blue: "#5E81AC",
|
|
3614
|
+
purple: "#B48EAD",
|
|
3615
|
+
pink: "#D4879C",
|
|
3616
|
+
magenta: "#B48EAD",
|
|
3617
|
+
white: "#ECEFF4"
|
|
3618
|
+
}[primaryOrHex] ?? "#5E81AC");
|
|
3619
|
+
if (mode === "dark") b.dark();
|
|
3620
|
+
else if (mode === "light") b.light();
|
|
3621
|
+
return b.build();
|
|
3622
|
+
}
|
|
3623
|
+
/**
|
|
3624
|
+
* Create a theme from a built-in preset name.
|
|
3625
|
+
*
|
|
3626
|
+
* @example
|
|
3627
|
+
* ```typescript
|
|
3628
|
+
* presetTheme('catppuccin-mocha')
|
|
3629
|
+
* presetTheme('nord')
|
|
3630
|
+
* ```
|
|
3631
|
+
*/
|
|
3632
|
+
function presetTheme(name) {
|
|
3633
|
+
return createTheme().preset(name).build();
|
|
3634
|
+
}
|
|
3635
|
+
//#endregion
|
|
3636
|
+
//#region packages/theme/src/auto-generate.ts
|
|
3637
|
+
/**
|
|
3638
|
+
* Auto-generate themes — create a complete Theme from a single primary color.
|
|
3639
|
+
*
|
|
3640
|
+
* Uses OKLCH color manipulation to derive complementary and analogous colors
|
|
3641
|
+
* for the full palette from one input color. OKLCH preserves perceived
|
|
3642
|
+
* lightness and chroma across hue rotations, so accent ramps look balanced.
|
|
3643
|
+
*/
|
|
3644
|
+
init_src();
|
|
3645
|
+
/** Standard OKLCH hue positions for semantic accents (degrees).
|
|
3646
|
+
* OKLCH hues differ from HSL: red≈29, orange≈55, yellow≈90, green≈142,
|
|
3647
|
+
* teal≈195, blue≈240, purple≈305, pink≈350. Calibrated against Ottosson's
|
|
3648
|
+
* reference ramps. */
|
|
3649
|
+
const HUE = {
|
|
3650
|
+
red: 29,
|
|
3651
|
+
orangeBright: 55,
|
|
3652
|
+
yellow: 90,
|
|
3653
|
+
green: 142,
|
|
3654
|
+
cyan: 195,
|
|
3655
|
+
blue: 240,
|
|
3656
|
+
magenta: 310,
|
|
3657
|
+
pinkBright: 350
|
|
3658
|
+
};
|
|
3659
|
+
/**
|
|
3660
|
+
* Generate a complete Theme from a single primary color.
|
|
3661
|
+
*
|
|
3662
|
+
* Derives a full ColorScheme using OKLCH color manipulation:
|
|
3663
|
+
* - Background/foreground from lightness endpoints using the primary's hue
|
|
3664
|
+
* - Complementary and analogous accent colors from hue rotation
|
|
3665
|
+
* - Surface ramp from bg lightness offsets
|
|
3666
|
+
* - Status colors (error, warning, success, info) from standard hue positions
|
|
3667
|
+
*
|
|
3668
|
+
* @param primaryColor - A hex color string (e.g. "#5E81AC")
|
|
3669
|
+
* @param mode - "dark" or "light" theme mode
|
|
3670
|
+
* @returns A complete Theme with all 33 semantic tokens
|
|
3671
|
+
*
|
|
3672
|
+
* @example
|
|
3673
|
+
* ```typescript
|
|
3674
|
+
* const theme = autoGenerateTheme("#5E81AC", "dark")
|
|
3675
|
+
* // Generates a full dark theme with blue as the primary accent
|
|
3676
|
+
*
|
|
3677
|
+
* const light = autoGenerateTheme("#E06C75", "light")
|
|
3678
|
+
* // Generates a full light theme with red/rose as the primary accent
|
|
3679
|
+
* ```
|
|
3680
|
+
*/
|
|
3681
|
+
function autoGenerateTheme(primaryColor, mode) {
|
|
3682
|
+
const o = hexToOklch(primaryColor);
|
|
3683
|
+
if (!o) return deriveTheme$1(fromColors({ dark: mode === "dark" }));
|
|
3684
|
+
const dark = mode === "dark";
|
|
3685
|
+
const bgL = dark ? .22 : .96;
|
|
3686
|
+
const fgL = dark ? .9 : .2;
|
|
3687
|
+
const bgC = Math.min(o.C, .03);
|
|
3688
|
+
const bg = oklchToHex({
|
|
3689
|
+
L: bgL,
|
|
3690
|
+
C: bgC,
|
|
3691
|
+
H: o.H
|
|
3692
|
+
});
|
|
3693
|
+
const fg = oklchToHex({
|
|
3694
|
+
L: fgL,
|
|
3695
|
+
C: bgC * .5,
|
|
3696
|
+
H: o.H
|
|
3697
|
+
});
|
|
3698
|
+
const accentL = dark ? .72 : .52;
|
|
3699
|
+
const accentC = Math.max(o.C, .1);
|
|
3700
|
+
const accent = (h) => oklchToHex({
|
|
3701
|
+
L: accentL,
|
|
3702
|
+
C: accentC,
|
|
3703
|
+
H: h
|
|
3704
|
+
});
|
|
3705
|
+
const red = accent(HUE.red);
|
|
3706
|
+
const green = accent(HUE.green);
|
|
3707
|
+
const yellow = accent(HUE.yellow);
|
|
3708
|
+
const blue = accent(HUE.blue);
|
|
3709
|
+
const magenta = accent(HUE.magenta);
|
|
3710
|
+
const cyan = accent(HUE.cyan);
|
|
3711
|
+
const brightL = accentL + (dark ? .1 : -.1);
|
|
3712
|
+
const brightAccent = (h) => oklchToHex({
|
|
3713
|
+
L: brightL,
|
|
3714
|
+
C: accentC,
|
|
3715
|
+
H: h
|
|
3716
|
+
});
|
|
3717
|
+
const brightRed = brightAccent(HUE.orangeBright);
|
|
3718
|
+
const brightGreen = brightAccent(HUE.green);
|
|
3719
|
+
const brightYellow = brightAccent(HUE.yellow);
|
|
3720
|
+
const brightBlue = brightAccent(HUE.blue);
|
|
3721
|
+
const brightMagenta = brightAccent(HUE.pinkBright);
|
|
3722
|
+
const brightCyan = brightAccent(HUE.cyan);
|
|
3723
|
+
const black = oklchToHex({
|
|
3724
|
+
L: dark ? bgL * .7 : bgL * .92,
|
|
3725
|
+
C: bgC,
|
|
3726
|
+
H: o.H
|
|
3727
|
+
});
|
|
3728
|
+
const white = oklchToHex({
|
|
3729
|
+
L: dark ? .6 : .35,
|
|
3730
|
+
C: bgC * .3,
|
|
3731
|
+
H: o.H
|
|
3732
|
+
});
|
|
3733
|
+
const brightBlack = oklchToHex({
|
|
3734
|
+
L: dark ? bgL + .1 : bgL - .08,
|
|
3735
|
+
C: bgC,
|
|
3736
|
+
H: o.H
|
|
3737
|
+
});
|
|
3738
|
+
const brightWhite = dark ? fg : oklchToHex({
|
|
3739
|
+
L: fgL - .05,
|
|
3740
|
+
C: bgC * .5,
|
|
3741
|
+
H: o.H
|
|
3742
|
+
});
|
|
3743
|
+
return deriveTheme$1({
|
|
3744
|
+
name: `generated-${mode}`,
|
|
3745
|
+
dark,
|
|
3746
|
+
primary: primaryColor,
|
|
3747
|
+
black,
|
|
3748
|
+
red,
|
|
3749
|
+
green,
|
|
3750
|
+
yellow,
|
|
3751
|
+
blue,
|
|
3752
|
+
magenta,
|
|
3753
|
+
cyan,
|
|
3754
|
+
white,
|
|
3755
|
+
brightBlack,
|
|
3756
|
+
brightRed,
|
|
3757
|
+
brightGreen,
|
|
3758
|
+
brightYellow,
|
|
3759
|
+
brightBlue,
|
|
3760
|
+
brightMagenta,
|
|
3761
|
+
brightCyan,
|
|
3762
|
+
brightWhite,
|
|
3763
|
+
foreground: fg,
|
|
3764
|
+
background: bg,
|
|
3765
|
+
cursorColor: fg,
|
|
3766
|
+
cursorText: bg,
|
|
3767
|
+
selectionBackground: blend(bg, primaryColor, .3),
|
|
3768
|
+
selectionForeground: fg
|
|
3769
|
+
});
|
|
3770
|
+
}
|
|
3771
|
+
//#endregion
|
|
3772
|
+
//#region packages/theme/src/validate.ts
|
|
3773
|
+
/**
|
|
3774
|
+
* Palette validation — checks ColorScheme fields and contrast.
|
|
3775
|
+
*/
|
|
3776
|
+
init_src();
|
|
3777
|
+
/**
|
|
3778
|
+
* Validate a ColorScheme.
|
|
3779
|
+
*
|
|
3780
|
+
* Checks:
|
|
3781
|
+
* - All 22 color fields are present and non-empty hex strings
|
|
3782
|
+
* - Warns on low-contrast foreground/background combinations
|
|
3783
|
+
*/
|
|
3784
|
+
function validateColorScheme(p) {
|
|
3785
|
+
const errors = [];
|
|
3786
|
+
const warnings = [];
|
|
3787
|
+
for (const field of COLOR_SCHEME_FIELDS) {
|
|
3788
|
+
const val = p[field];
|
|
3789
|
+
if (!val || typeof val !== "string") errors.push(`${field} is required and must be a non-empty string`);
|
|
3790
|
+
}
|
|
3791
|
+
if (p.foreground && p.background) {
|
|
3792
|
+
const fgRgb = hexToRgb(p.foreground);
|
|
3793
|
+
const bgRgb = hexToRgb(p.background);
|
|
3794
|
+
if (fgRgb && bgRgb) {
|
|
3795
|
+
const fgSum = fgRgb[0] + fgRgb[1] + fgRgb[2];
|
|
3796
|
+
const bgSum = bgRgb[0] + bgRgb[1] + bgRgb[2];
|
|
3797
|
+
if (fgSum > 384 === bgSum > 384) warnings.push(`Low contrast: foreground (${p.foreground}) and background (${p.background}) have similar lightness`);
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
return {
|
|
3801
|
+
valid: errors.length === 0,
|
|
3802
|
+
errors,
|
|
3803
|
+
warnings
|
|
3804
|
+
};
|
|
3805
|
+
}
|
|
3806
|
+
//#endregion
|
|
3807
|
+
//#region packages/theme/src/validate-theme.ts
|
|
3808
|
+
/**
|
|
3809
|
+
* Theme validation — checks that all required semantic tokens are present.
|
|
3810
|
+
*
|
|
3811
|
+
* Complements validateColorScheme() which validates the lower-level
|
|
3812
|
+
* ColorScheme. This validates the derived Theme object.
|
|
3813
|
+
*/
|
|
3814
|
+
/** All 33 required semantic token keys on Theme (excludes `name` and `palette`). */
|
|
3815
|
+
const THEME_TOKEN_KEYS = [
|
|
3816
|
+
"bg",
|
|
3817
|
+
"fg",
|
|
3818
|
+
"muted",
|
|
3819
|
+
"mutedbg",
|
|
3820
|
+
"surface",
|
|
3821
|
+
"surfacebg",
|
|
3822
|
+
"popover",
|
|
3823
|
+
"popoverbg",
|
|
3824
|
+
"inverse",
|
|
3825
|
+
"inversebg",
|
|
3826
|
+
"cursor",
|
|
3827
|
+
"cursorbg",
|
|
3828
|
+
"selection",
|
|
3829
|
+
"selectionbg",
|
|
3830
|
+
"primary",
|
|
3831
|
+
"primaryfg",
|
|
3832
|
+
"secondary",
|
|
3833
|
+
"secondaryfg",
|
|
3834
|
+
"accent",
|
|
3835
|
+
"accentfg",
|
|
3836
|
+
"error",
|
|
3837
|
+
"errorfg",
|
|
3838
|
+
"warning",
|
|
3839
|
+
"warningfg",
|
|
3840
|
+
"success",
|
|
3841
|
+
"successfg",
|
|
3842
|
+
"info",
|
|
3843
|
+
"infofg",
|
|
3844
|
+
"border",
|
|
3845
|
+
"inputborder",
|
|
3846
|
+
"focusborder",
|
|
3847
|
+
"link",
|
|
3848
|
+
"disabledfg"
|
|
3849
|
+
];
|
|
3850
|
+
/** All recognized keys on Theme (tokens + metadata). */
|
|
3851
|
+
const ALL_KNOWN_KEYS = new Set([
|
|
3852
|
+
...THEME_TOKEN_KEYS,
|
|
3853
|
+
"name",
|
|
3854
|
+
"palette"
|
|
3855
|
+
]);
|
|
3856
|
+
/**
|
|
3857
|
+
* Validate a Theme object — check that all required tokens are present.
|
|
3858
|
+
*
|
|
3859
|
+
* @param theme - The theme object to validate
|
|
3860
|
+
* @returns Validation result with missing and extra token lists
|
|
3861
|
+
*
|
|
3862
|
+
* @example
|
|
3863
|
+
* ```typescript
|
|
3864
|
+
* const result = validateTheme(myTheme)
|
|
3865
|
+
* if (!result.valid) {
|
|
3866
|
+
* console.log("Missing tokens:", result.missing)
|
|
3867
|
+
* }
|
|
3868
|
+
* ```
|
|
3869
|
+
*/
|
|
3870
|
+
function validateTheme(theme) {
|
|
3871
|
+
const missing = [];
|
|
3872
|
+
const extra = [];
|
|
3873
|
+
for (const key of THEME_TOKEN_KEYS) {
|
|
3874
|
+
const val = theme[key];
|
|
3875
|
+
if (val === void 0 || val === null || val === "") missing.push(key);
|
|
3876
|
+
}
|
|
3877
|
+
for (const key of Object.keys(theme)) if (!ALL_KNOWN_KEYS.has(key)) extra.push(key);
|
|
3878
|
+
return {
|
|
3879
|
+
valid: missing.length === 0,
|
|
3880
|
+
missing,
|
|
3881
|
+
extra
|
|
3882
|
+
};
|
|
3883
|
+
}
|
|
3884
|
+
//#endregion
|
|
3885
|
+
//#region packages/theme/src/alias.ts
|
|
3886
|
+
/** Maximum depth for alias chain resolution before treating as circular. */
|
|
3887
|
+
const MAX_ALIAS_DEPTH = 10;
|
|
3888
|
+
/**
|
|
3889
|
+
* Resolve all token aliases in a theme.
|
|
3890
|
+
*
|
|
3891
|
+
* Token values that start with `$` are treated as references to other tokens.
|
|
3892
|
+
* Alias chains are followed until a concrete (non-$) value is reached.
|
|
3893
|
+
* Circular references are detected via a depth limit and left unresolved.
|
|
3894
|
+
*
|
|
3895
|
+
* @param theme - A theme-like object where values may reference other tokens via `$name`
|
|
3896
|
+
* @returns A new object with all aliases resolved to concrete values
|
|
3897
|
+
*
|
|
3898
|
+
* @example
|
|
3899
|
+
* ```typescript
|
|
3900
|
+
* const themed = resolveAliases({
|
|
3901
|
+
* ...baseTheme,
|
|
3902
|
+
* button: "$primary", // resolves to the value of 'primary'
|
|
3903
|
+
* buttonHover: "$button", // chain: buttonHover -> button -> primary -> hex
|
|
3904
|
+
* })
|
|
3905
|
+
* ```
|
|
3906
|
+
*/
|
|
3907
|
+
function resolveAliases(theme) {
|
|
3908
|
+
const result = {};
|
|
3909
|
+
for (const key of Object.keys(theme)) result[key] = resolveAlias(key, theme, 0);
|
|
3910
|
+
return result;
|
|
3911
|
+
}
|
|
3912
|
+
/**
|
|
3913
|
+
* Resolve a single token's alias chain.
|
|
3914
|
+
*
|
|
3915
|
+
* @param key - The token key to resolve
|
|
3916
|
+
* @param tokens - The full token map
|
|
3917
|
+
* @param depth - Current recursion depth (for loop detection)
|
|
3918
|
+
* @returns The resolved concrete value, or the raw alias string if unresolvable
|
|
3919
|
+
*/
|
|
3920
|
+
function resolveAlias(key, tokens, depth) {
|
|
3921
|
+
if (depth >= MAX_ALIAS_DEPTH) return tokens[key] ?? "";
|
|
3922
|
+
const value = tokens[key];
|
|
3923
|
+
if (value === void 0) return "";
|
|
3924
|
+
if (!value.startsWith("$")) return value;
|
|
3925
|
+
const refKey = value.slice(1);
|
|
3926
|
+
if (!(refKey in tokens)) return value;
|
|
3927
|
+
return resolveAlias(refKey, tokens, depth + 1);
|
|
3928
|
+
}
|
|
3929
|
+
/**
|
|
3930
|
+
* Resolve a single alias value against a Theme.
|
|
3931
|
+
*
|
|
3932
|
+
* Useful for resolving individual values without processing the entire theme.
|
|
3933
|
+
*
|
|
3934
|
+
* @param value - The value to resolve (may be "$tokenName" or a concrete value)
|
|
3935
|
+
* @param theme - The theme to resolve against
|
|
3936
|
+
* @returns The resolved concrete value
|
|
3937
|
+
*/
|
|
3938
|
+
function resolveTokenAlias(value, theme) {
|
|
3939
|
+
if (!value.startsWith("$")) return value;
|
|
3940
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3941
|
+
let current = value;
|
|
3942
|
+
for (let i = 0; i < MAX_ALIAS_DEPTH; i++) {
|
|
3943
|
+
if (!current.startsWith("$")) return current;
|
|
3944
|
+
const key = current.slice(1);
|
|
3945
|
+
if (seen.has(key)) return current;
|
|
3946
|
+
seen.add(key);
|
|
3947
|
+
const resolved = theme[key];
|
|
3948
|
+
if (typeof resolved !== "string") return current;
|
|
3949
|
+
current = resolved;
|
|
3950
|
+
}
|
|
3951
|
+
return current;
|
|
3952
|
+
}
|
|
3953
|
+
//#endregion
|
|
3954
|
+
//#region packages/theme/src/sterling/flat-tokens.ts
|
|
3955
|
+
const STERLING_FLAT_TOKENS = [
|
|
3956
|
+
"bg-surface-default",
|
|
3957
|
+
"bg-surface-subtle",
|
|
3958
|
+
"bg-surface-raised",
|
|
3959
|
+
"bg-surface-overlay",
|
|
3960
|
+
"bg-surface-hover",
|
|
3961
|
+
"border-default",
|
|
3962
|
+
"border-focus",
|
|
3963
|
+
"border-muted",
|
|
3964
|
+
"fg-cursor",
|
|
3965
|
+
"bg-cursor",
|
|
3966
|
+
"fg-muted",
|
|
3967
|
+
"bg-muted",
|
|
3968
|
+
"fg-accent",
|
|
3969
|
+
"bg-accent",
|
|
3970
|
+
"fg-on-accent",
|
|
3971
|
+
"fg-accent-hover",
|
|
3972
|
+
"bg-accent-hover",
|
|
3973
|
+
"fg-accent-active",
|
|
3974
|
+
"bg-accent-active",
|
|
3975
|
+
"border-accent",
|
|
3976
|
+
"fg-info",
|
|
3977
|
+
"bg-info",
|
|
3978
|
+
"fg-on-info",
|
|
3979
|
+
"bg-info-hover",
|
|
3980
|
+
"bg-info-active",
|
|
3981
|
+
"fg-success",
|
|
3982
|
+
"bg-success",
|
|
3983
|
+
"fg-on-success",
|
|
3984
|
+
"bg-success-hover",
|
|
3985
|
+
"bg-success-active",
|
|
3986
|
+
"fg-warning",
|
|
3987
|
+
"bg-warning",
|
|
3988
|
+
"fg-on-warning",
|
|
3989
|
+
"bg-warning-hover",
|
|
3990
|
+
"bg-warning-active",
|
|
3991
|
+
"fg-error",
|
|
3992
|
+
"bg-error",
|
|
3993
|
+
"fg-on-error",
|
|
3994
|
+
"bg-error-hover",
|
|
3995
|
+
"bg-error-active"
|
|
3996
|
+
];
|
|
3997
|
+
//#endregion
|
|
3998
|
+
//#region packages/theme/src/css.ts
|
|
3999
|
+
/**
|
|
4000
|
+
* Convert a Theme to CSS custom properties.
|
|
4001
|
+
*
|
|
4002
|
+
* Token names mirror Sterling's flat grammar with a `--` prefix:
|
|
4003
|
+
* - `bg-surface-default` → `--bg-surface-default`
|
|
4004
|
+
* - `fg-accent` → `--fg-accent`
|
|
4005
|
+
* - `border-focus` → `--border-focus`
|
|
4006
|
+
* - Palette entries: `--color0` through `--color15`
|
|
4007
|
+
*
|
|
4008
|
+
* @param theme - The theme to convert (Sterling flat tokens must be populated)
|
|
4009
|
+
* @returns A record mapping CSS custom property names to color values
|
|
4010
|
+
*
|
|
4011
|
+
* @example
|
|
4012
|
+
* ```typescript
|
|
4013
|
+
* const vars = themeToCSSVars(myTheme)
|
|
4014
|
+
* // { "--bg-surface-default": "#1E1E2E", "--fg-accent": "#F9E2AF", ... }
|
|
4015
|
+
*
|
|
4016
|
+
* // Apply to an element:
|
|
4017
|
+
* Object.assign(element.style, vars)
|
|
4018
|
+
* ```
|
|
4019
|
+
*/
|
|
4020
|
+
function themeToCSSVars(theme) {
|
|
4021
|
+
const vars = {};
|
|
4022
|
+
const flat = theme;
|
|
4023
|
+
for (const key of STERLING_FLAT_TOKENS) {
|
|
4024
|
+
const value = flat[key];
|
|
4025
|
+
if (typeof value === "string") vars[`--${key}`] = value;
|
|
4026
|
+
}
|
|
4027
|
+
if (theme.palette) for (let i = 0; i < theme.palette.length; i++) vars[`--color${i}`] = theme.palette[i];
|
|
4028
|
+
return vars;
|
|
4029
|
+
}
|
|
4030
|
+
//#endregion
|
|
4031
|
+
//#region packages/theme/src/export/base16.ts
|
|
4032
|
+
/**
|
|
4033
|
+
* Export ColorScheme to Base16 YAML format.
|
|
4034
|
+
*
|
|
4035
|
+
* Maps ColorScheme fields to base00–base0F. For fields that
|
|
4036
|
+
* ColorScheme doesn't store directly (base04/base06/base07),
|
|
4037
|
+
* we interpolate between neighboring values.
|
|
4038
|
+
*
|
|
4039
|
+
* @see https://github.com/chriskempson/base16
|
|
4040
|
+
*/
|
|
4041
|
+
/** Strip `#` prefix from a hex color string and uppercase. */
|
|
4042
|
+
function stripHash(hex) {
|
|
4043
|
+
return (hex.startsWith("#") ? hex.slice(1) : hex).toUpperCase();
|
|
4044
|
+
}
|
|
4045
|
+
/**
|
|
4046
|
+
* Export a ColorScheme to Base16 YAML format.
|
|
4047
|
+
*
|
|
4048
|
+
* Mapping:
|
|
4049
|
+
* background → base00, brightBlack → base01, selectionBackground → base02,
|
|
4050
|
+
* white → base03, (interpolated) → base04, foreground → base05,
|
|
4051
|
+
* (interpolated) → base06, (interpolated) → base07,
|
|
4052
|
+
* red → base08, brightRed → base09, yellow → base0A, green → base0B,
|
|
4053
|
+
* cyan → base0C, blue → base0D, magenta → base0E, brightMagenta → base0F.
|
|
4054
|
+
*/
|
|
4055
|
+
function exportBase16(palette) {
|
|
4056
|
+
const dark = palette.dark ?? true;
|
|
4057
|
+
const base04 = blend(palette.white, palette.foreground, .33);
|
|
4058
|
+
const base06 = dark ? blend(palette.foreground, "#FFFFFF", .15) : blend(palette.foreground, "#000000", .15);
|
|
4059
|
+
const base07 = palette.black;
|
|
4060
|
+
return [
|
|
4061
|
+
`scheme: "${palette.name ?? "exported"}"`,
|
|
4062
|
+
`author: ""`,
|
|
4063
|
+
`base00: "${stripHash(palette.background)}"`,
|
|
4064
|
+
`base01: "${stripHash(palette.brightBlack)}"`,
|
|
4065
|
+
`base02: "${stripHash(palette.selectionBackground)}"`,
|
|
4066
|
+
`base03: "${stripHash(palette.white)}"`,
|
|
4067
|
+
`base04: "${stripHash(base04)}"`,
|
|
4068
|
+
`base05: "${stripHash(palette.foreground)}"`,
|
|
4069
|
+
`base06: "${stripHash(base06)}"`,
|
|
4070
|
+
`base07: "${stripHash(base07)}"`,
|
|
4071
|
+
`base08: "${stripHash(palette.red)}"`,
|
|
4072
|
+
`base09: "${stripHash(palette.brightRed)}"`,
|
|
4073
|
+
`base0A: "${stripHash(palette.yellow)}"`,
|
|
4074
|
+
`base0B: "${stripHash(palette.green)}"`,
|
|
4075
|
+
`base0C: "${stripHash(palette.cyan)}"`,
|
|
4076
|
+
`base0D: "${stripHash(palette.blue)}"`,
|
|
4077
|
+
`base0E: "${stripHash(palette.magenta)}"`,
|
|
4078
|
+
`base0F: "${stripHash(palette.brightMagenta)}"`
|
|
4079
|
+
].join("\n") + "\n";
|
|
4080
|
+
}
|
|
4081
|
+
//#endregion
|
|
4082
|
+
//#region packages/theme/src/detect.ts
|
|
4083
|
+
init_src();
|
|
4084
|
+
/**
|
|
4085
|
+
* Detect the terminal's palette and return a Sterling-aware Theme.
|
|
4086
|
+
*
|
|
4087
|
+
* Identical to `@silvery/ansi`'s `detectTheme` but every returned theme has
|
|
4088
|
+
* Sterling flat tokens baked in via `inlineSterlingTokens`.
|
|
4089
|
+
*/
|
|
4090
|
+
async function detectTheme(opts = {}) {
|
|
4091
|
+
return inlineSterlingTokens(await detectTheme$1(opts));
|
|
4092
|
+
}
|
|
4093
|
+
//#endregion
|
|
4094
|
+
//#region packages/theme/src/sterling/defaults.ts
|
|
4095
|
+
/**
|
|
4096
|
+
* A hand-tuned neutral dark scheme — not a copy of any catalog palette, but
|
|
4097
|
+
* close to Nord/Dracula territory. Used only when the caller asks for a
|
|
4098
|
+
* "raw default" (no scheme at all).
|
|
4099
|
+
*/
|
|
4100
|
+
const darkBaseline = {
|
|
4101
|
+
name: "sterling-dark",
|
|
4102
|
+
dark: true,
|
|
4103
|
+
primary: "#7FB4CA",
|
|
4104
|
+
black: "#1E1E2E",
|
|
4105
|
+
red: "#E06C75",
|
|
4106
|
+
green: "#98C379",
|
|
4107
|
+
yellow: "#E5C07B",
|
|
4108
|
+
blue: "#61AFEF",
|
|
4109
|
+
magenta: "#C678DD",
|
|
4110
|
+
cyan: "#56B6C2",
|
|
4111
|
+
white: "#ABB2BF",
|
|
4112
|
+
brightBlack: "#5C6370",
|
|
4113
|
+
brightRed: "#E06C75",
|
|
4114
|
+
brightGreen: "#98C379",
|
|
4115
|
+
brightYellow: "#E5C07B",
|
|
4116
|
+
brightBlue: "#61AFEF",
|
|
4117
|
+
brightMagenta: "#C678DD",
|
|
4118
|
+
brightCyan: "#56B6C2",
|
|
4119
|
+
brightWhite: "#FFFFFF",
|
|
4120
|
+
foreground: "#E4E4E7",
|
|
4121
|
+
background: "#16181D",
|
|
4122
|
+
cursorColor: "#E4E4E7",
|
|
4123
|
+
cursorText: "#16181D",
|
|
4124
|
+
selectionBackground: "#3E4452",
|
|
4125
|
+
selectionForeground: "#E4E4E7"
|
|
4126
|
+
};
|
|
4127
|
+
const lightBaseline = {
|
|
4128
|
+
name: "sterling-light",
|
|
4129
|
+
dark: false,
|
|
4130
|
+
primary: "#1F6FEB",
|
|
4131
|
+
black: "#24292F",
|
|
4132
|
+
red: "#CF222E",
|
|
4133
|
+
green: "#1A7F37",
|
|
4134
|
+
yellow: "#9A6700",
|
|
4135
|
+
blue: "#0969DA",
|
|
4136
|
+
magenta: "#8250DF",
|
|
4137
|
+
cyan: "#1B7C83",
|
|
4138
|
+
white: "#6E7781",
|
|
4139
|
+
brightBlack: "#57606A",
|
|
4140
|
+
brightRed: "#A40E26",
|
|
4141
|
+
brightGreen: "#2DA44E",
|
|
4142
|
+
brightYellow: "#BF8700",
|
|
4143
|
+
brightBlue: "#218BFF",
|
|
4144
|
+
brightMagenta: "#A475F9",
|
|
4145
|
+
brightCyan: "#3192AA",
|
|
4146
|
+
brightWhite: "#8C959F",
|
|
4147
|
+
foreground: "#1F2328",
|
|
4148
|
+
background: "#FFFFFF",
|
|
4149
|
+
cursorColor: "#1F2328",
|
|
4150
|
+
cursorText: "#FFFFFF",
|
|
4151
|
+
selectionBackground: "#DDF4FF",
|
|
4152
|
+
selectionForeground: "#1F2328"
|
|
4153
|
+
};
|
|
4154
|
+
function defaultScheme(mode = "dark") {
|
|
4155
|
+
return mode === "dark" ? darkBaseline : lightBaseline;
|
|
4156
|
+
}
|
|
4157
|
+
//#endregion
|
|
4158
|
+
//#region packages/theme/src/sterling/define.ts
|
|
4159
|
+
init_src();
|
|
4160
|
+
function resolveFlatten(flatten) {
|
|
4161
|
+
if (flatten === false || flatten === void 0) return (t) => t;
|
|
4162
|
+
if (typeof flatten === "function") {
|
|
4163
|
+
const rule = flatten;
|
|
4164
|
+
return (t) => bakeFlat(t, rule);
|
|
4165
|
+
}
|
|
4166
|
+
return (t) => bakeFlat(t);
|
|
4167
|
+
}
|
|
4168
|
+
/**
|
|
4169
|
+
* Wrap a DesignSystem so every derivation method auto-applies `bakeFlat`
|
|
4170
|
+
* per the `flatten` flag. Pass your raw system (one that returns nested
|
|
4171
|
+
* themes) and this returns a user-facing system whose outputs have flat
|
|
4172
|
+
* keys populated.
|
|
4173
|
+
*/
|
|
4174
|
+
function defineDesignSystem(def) {
|
|
4175
|
+
const flatten = resolveFlatten(def.flatten);
|
|
4176
|
+
return {
|
|
4177
|
+
name: def.name,
|
|
4178
|
+
shape: def.shape,
|
|
4179
|
+
flatten: def.flatten,
|
|
4180
|
+
defaults: (mode) => flatten(def.defaults(mode)),
|
|
4181
|
+
theme: (partial, opts) => flatten(def.theme(partial, opts)),
|
|
4182
|
+
deriveFromScheme: (scheme, opts) => flatten(def.deriveFromScheme(scheme, opts)),
|
|
4183
|
+
deriveFromColor: (color, opts) => flatten(def.deriveFromColor(color, opts)),
|
|
4184
|
+
deriveFromPair: (light, dark, opts) => {
|
|
4185
|
+
const pair = def.deriveFromPair(light, dark, opts);
|
|
4186
|
+
return {
|
|
4187
|
+
light: flatten(pair.light),
|
|
4188
|
+
dark: flatten(pair.dark)
|
|
4189
|
+
};
|
|
4190
|
+
},
|
|
4191
|
+
deriveFromSchemeWithBrand: (scheme, brand, opts) => flatten(def.deriveFromSchemeWithBrand(scheme, brand, opts))
|
|
4192
|
+
};
|
|
4193
|
+
}
|
|
4194
|
+
//#endregion
|
|
4195
|
+
//#region packages/theme/src/sterling/sterling.ts
|
|
4196
|
+
/**
|
|
4197
|
+
* Sterling — silvery's canonical DesignSystem.
|
|
4198
|
+
*
|
|
4199
|
+
* This is the default system shipped from `@silvery/theme`. It implements
|
|
4200
|
+
* the `DesignSystem` contract from `types.ts` and serves as the reference
|
|
4201
|
+
* for alternative systems (`@silvery/design-material`, `-primer`, etc.).
|
|
4202
|
+
*
|
|
4203
|
+
* The flat-projection (`theme["bg-accent"]` as a sibling of `theme.accent.bg`
|
|
4204
|
+
* on the same object) is NOT Sterling-specific — it's a framework feature.
|
|
4205
|
+
* Sterling opts in via `flatten: true` in {@link defineDesignSystem}, which
|
|
4206
|
+
* auto-applies `bakeFlat` (from `@silvery/ansi`) to every derivation's
|
|
4207
|
+
* output. The default rule is channel-role-state (`fg-accent`, `bg-accent-hover`,
|
|
4208
|
+
* `fg-on-error`, `bg-surface-subtle`, `border-focus`, …) — exactly what
|
|
4209
|
+
* Sterling's pre-generalization `populateFlat` produced.
|
|
4210
|
+
*
|
|
4211
|
+
* All derivation functions return a frozen Theme with both nested roles
|
|
4212
|
+
* AND flat hyphen keys populated — the user-facing `$fg-accent` syntax
|
|
4213
|
+
* resolves against the flat keys, while programmatic access uses nested.
|
|
4214
|
+
*/
|
|
4215
|
+
const STERLING_SHAPE = {
|
|
4216
|
+
flatTokens: STERLING_FLAT_TOKENS,
|
|
4217
|
+
roles: [
|
|
4218
|
+
"accent",
|
|
4219
|
+
"info",
|
|
4220
|
+
"success",
|
|
4221
|
+
"warning",
|
|
4222
|
+
"error",
|
|
4223
|
+
"muted",
|
|
4224
|
+
"surface",
|
|
4225
|
+
"border",
|
|
4226
|
+
"cursor"
|
|
4227
|
+
],
|
|
4228
|
+
states: ["hover", "active"]
|
|
4229
|
+
};
|
|
4230
|
+
/**
|
|
4231
|
+
* Internal: build a nested Theme (no flat keys). `defineDesignSystem` applies
|
|
4232
|
+
* `bakeFlat` afterwards — the inner derivation stays flat-agnostic.
|
|
4233
|
+
*/
|
|
4234
|
+
function buildRawTheme(scheme, opts = {}) {
|
|
4235
|
+
return deriveTheme(scheme, opts);
|
|
4236
|
+
}
|
|
4237
|
+
/**
|
|
4238
|
+
* Apply a brand overlay to a ColorScheme — overrides `primary` and relevant
|
|
4239
|
+
* ANSI hue slots with the brand color. Keeps the rest of the scheme intact.
|
|
4240
|
+
* Per Appendix F: brand is a theme INPUT, not a public token sibling of accent.
|
|
4241
|
+
*/
|
|
4242
|
+
function applyBrand(scheme, brand) {
|
|
4243
|
+
return {
|
|
4244
|
+
...scheme,
|
|
4245
|
+
primary: brand
|
|
4246
|
+
};
|
|
4247
|
+
}
|
|
4248
|
+
/**
|
|
4249
|
+
* Sterling — the user-facing DesignSystem. `defineDesignSystem` wraps
|
|
4250
|
+
* `rawSterling` with auto-`bakeFlat` (per `flatten: true`), so every
|
|
4251
|
+
* returned Theme has both nested roles AND flat hyphen keys populated.
|
|
4252
|
+
*/
|
|
4253
|
+
const sterling = defineDesignSystem({
|
|
4254
|
+
name: "sterling",
|
|
4255
|
+
shape: STERLING_SHAPE,
|
|
4256
|
+
flatten: true,
|
|
4257
|
+
defaults(mode = "dark") {
|
|
4258
|
+
return buildRawTheme(defaultScheme(mode), { contrast: "auto-lift" });
|
|
4259
|
+
},
|
|
4260
|
+
theme(partial, opts = {}) {
|
|
4261
|
+
const base = buildRawTheme(defaultScheme(opts.mode ?? "dark"), {
|
|
4262
|
+
...opts,
|
|
4263
|
+
contrast: opts.contrast ?? "auto-lift"
|
|
4264
|
+
});
|
|
4265
|
+
if (!partial) return base;
|
|
4266
|
+
return mergePartial(base, partial);
|
|
4267
|
+
},
|
|
4268
|
+
deriveFromScheme(scheme, opts = {}) {
|
|
4269
|
+
return buildRawTheme(scheme, opts);
|
|
4270
|
+
},
|
|
4271
|
+
deriveFromColor(color, opts = {}) {
|
|
4272
|
+
return buildRawTheme({
|
|
4273
|
+
...defaultScheme(opts.mode ?? "dark"),
|
|
4274
|
+
name: `seed:${color}`,
|
|
4275
|
+
primary: color,
|
|
4276
|
+
blue: color,
|
|
4277
|
+
brightBlue: blend(color, "#ffffff", .15)
|
|
4278
|
+
}, opts);
|
|
4279
|
+
},
|
|
4280
|
+
deriveFromPair(light, dark, opts = {}) {
|
|
4281
|
+
return {
|
|
4282
|
+
light: buildRawTheme(light, {
|
|
4283
|
+
...opts,
|
|
4284
|
+
mode: "light"
|
|
4285
|
+
}),
|
|
4286
|
+
dark: buildRawTheme(dark, {
|
|
4287
|
+
...opts,
|
|
4288
|
+
mode: "dark"
|
|
4289
|
+
})
|
|
4290
|
+
};
|
|
4291
|
+
},
|
|
4292
|
+
deriveFromSchemeWithBrand(scheme, brand, opts = {}) {
|
|
4293
|
+
return buildRawTheme(applyBrand(scheme, brand), opts);
|
|
4294
|
+
}
|
|
4295
|
+
});
|
|
4296
|
+
//#endregion
|
|
4297
|
+
//#region packages/theme/src/sterling/index.ts
|
|
4298
|
+
init_src();
|
|
4299
|
+
//#endregion
|
|
4300
|
+
//#region packages/theme/src/theme.ts
|
|
4301
|
+
init_src();
|
|
4302
|
+
//#endregion
|
|
4303
|
+
export { kanagawaLotus as $, modusVivendi as A, nightfox as B, builtinPalettes as C, checkAA as Ct, getSchemeByName as D, defaultLightTheme as E, oxocarbonLight as F, materialDark as G, ayuLight as H, nightfly as I, monokai as J, materialLight as K, moonfly as L, edgeLight as M, sonokai as N, getThemeByName as O, oxocarbonDark as P, kanagawaDragon as Q, horizon as R, ansi16LightTheme as S, autoLift as St, defaultDarkTheme as T, generateTheme as Tt, ayuMirage as U, ayuDark as V, palenight as W, everforestDark as X, monokaiPro as Y, everforestLight as Z, assignPrimaryToSlot as _, catppuccinMocha as _t, exportBase16 as a, gruvboxLight as at, fromPreset as b, ContrastError as bt, resolveAliases as c, tokyoNightDay as ct, validateTheme as d, solarizedLight as dt, kanagawaWave as et, validateColorScheme as f, dracula as ft, quickTheme as g, catppuccinMacchiato as gt, presetTheme as h, catppuccinLatte as ht, detectTheme as i, gruvboxDark as it, edgeDark as j, modusOperandi as k, resolveTokenAlias as l, tokyoNightStorm as lt, createTheme as m, catppuccinFrappe as mt, defineDesignSystem as n, rosePineDawn as nt, themeToCSSVars as o, oneDark as ot, autoGenerateTheme as p, nord as pt, snazzy as q, defaultScheme as r, rosePineMoon as rt, STERLING_FLAT_TOKENS as s, tokyoNight as st, sterling as t, rosePine as tt, THEME_TOKEN_KEYS as u, solarizedDark as ut, fromBase16 as v, deriveRoles as vt, builtinThemes as w, importBase16 as wt, ansi16DarkTheme as x, WCAG_AA as xt, fromColors as y, deriveTheme as yt, dawnfox as z };
|
|
4304
|
+
|
|
4305
|
+
//# sourceMappingURL=src-B5GjfG7g.mjs.map
|