@promptctl/rich-js 0.18.0 → 0.18.1
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/core/anchor.d.ts +45 -0
- package/dist/core/anchor.js +39 -0
- package/dist/core/ansi.d.ts +65 -0
- package/dist/core/ansi.js +231 -0
- package/dist/core/box.d.ts +143 -0
- package/dist/core/box.js +379 -0
- package/dist/core/cells.d.ts +159 -0
- package/dist/core/cells.js +287 -0
- package/dist/core/color.d.ts +246 -0
- package/dist/core/color.js +1038 -0
- package/dist/core/console.d.ts +165 -0
- package/dist/core/console.js +527 -0
- package/dist/core/emoji.d.ts +24 -0
- package/dist/core/emoji.js +391 -0
- package/dist/core/export-html.d.ts +59 -0
- package/dist/core/export-html.js +200 -0
- package/dist/core/export-lines.d.ts +121 -0
- package/dist/core/export-lines.js +141 -0
- package/dist/core/highlighter.d.ts +33 -0
- package/dist/core/highlighter.js +124 -0
- package/dist/core/json.d.ts +27 -0
- package/dist/core/json.js +53 -0
- package/dist/core/markup.d.ts +119 -0
- package/dist/core/markup.js +731 -0
- package/dist/core/measure.d.ts +27 -0
- package/dist/core/measure.js +62 -0
- package/dist/core/oklch.d.ts +161 -0
- package/dist/core/oklch.js +312 -0
- package/dist/core/osc8.d.ts +68 -0
- package/dist/core/osc8.js +90 -0
- package/dist/core/place.d.ts +30 -0
- package/dist/core/place.js +51 -0
- package/dist/core/pretty.d.ts +144 -0
- package/dist/core/pretty.js +476 -0
- package/dist/core/protocol.d.ts +267 -0
- package/dist/core/protocol.js +163 -0
- package/dist/core/render.d.ts +84 -0
- package/dist/core/render.js +145 -0
- package/dist/core/segment.d.ts +161 -0
- package/dist/core/segment.js +492 -0
- package/dist/core/spinnerData.d.ts +12 -0
- package/dist/core/spinnerData.js +117 -0
- package/dist/core/strip.d.ts +141 -0
- package/dist/core/strip.js +305 -0
- package/dist/core/style.d.ts +169 -0
- package/dist/core/style.js +695 -0
- package/dist/core/subscription.d.ts +12 -0
- package/dist/core/subscription.js +12 -0
- package/dist/core/text.d.ts +256 -0
- package/dist/core/text.js +976 -0
- package/dist/core/wrap.d.ts +41 -0
- package/dist/core/wrap.js +127 -0
- package/dist/host/app.d.ts +121 -0
- package/dist/host/app.js +255 -0
- package/dist/host/host-environment.d.ts +26 -0
- package/dist/host/host-environment.js +44 -0
- package/dist/host/index.d.ts +5 -0
- package/dist/host/index.js +3 -0
- package/dist/host/terminal-host.d.ts +179 -0
- package/dist/host/terminal-host.js +186 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +107 -0
- package/dist/node/prompt.d.ts +21 -0
- package/dist/node/prompt.js +30 -0
- package/dist/node/save.d.ts +17 -0
- package/dist/node/save.js +21 -0
- package/dist/node/terminal-host.d.ts +113 -0
- package/dist/node/terminal-host.js +227 -0
- package/dist/node/traceback.d.ts +37 -0
- package/dist/node/traceback.js +134 -0
- package/dist/renderables/align.d.ts +16 -0
- package/dist/renderables/align.js +33 -0
- package/dist/renderables/columns.d.ts +61 -0
- package/dist/renderables/columns.js +152 -0
- package/dist/renderables/constrain.d.ts +15 -0
- package/dist/renderables/constrain.js +37 -0
- package/dist/renderables/embed.d.ts +50 -0
- package/dist/renderables/embed.js +71 -0
- package/dist/renderables/flexStrip.d.ts +41 -0
- package/dist/renderables/flexStrip.js +200 -0
- package/dist/renderables/group.d.ts +11 -0
- package/dist/renderables/group.js +17 -0
- package/dist/renderables/layout.d.ts +92 -0
- package/dist/renderables/layout.js +312 -0
- package/dist/renderables/live.d.ts +50 -0
- package/dist/renderables/live.js +175 -0
- package/dist/renderables/markdown.d.ts +24 -0
- package/dist/renderables/markdown.js +184 -0
- package/dist/renderables/padding.d.ts +38 -0
- package/dist/renderables/padding.js +141 -0
- package/dist/renderables/panel.d.ts +116 -0
- package/dist/renderables/panel.js +307 -0
- package/dist/renderables/progress.d.ts +90 -0
- package/dist/renderables/progress.js +238 -0
- package/dist/renderables/progressBar.d.ts +31 -0
- package/dist/renderables/progressBar.js +53 -0
- package/dist/renderables/prompt.d.ts +49 -0
- package/dist/renderables/prompt.js +125 -0
- package/dist/renderables/rule.d.ts +25 -0
- package/dist/renderables/rule.js +90 -0
- package/dist/renderables/spinner.d.ts +31 -0
- package/dist/renderables/spinner.js +70 -0
- package/dist/renderables/status.d.ts +23 -0
- package/dist/renderables/status.js +60 -0
- package/dist/renderables/syntax.d.ts +35 -0
- package/dist/renderables/syntax.js +115 -0
- package/dist/renderables/table.d.ts +194 -0
- package/dist/renderables/table.js +795 -0
- package/dist/renderables/traceback.d.ts +31 -0
- package/dist/renderables/traceback.js +108 -0
- package/dist/renderables/tree.d.ts +68 -0
- package/dist/renderables/tree.js +150 -0
- package/dist/renderables/viewport.d.ts +114 -0
- package/dist/renderables/viewport.js +198 -0
- package/dist/template-bindings/color-funcs.d.ts +87 -0
- package/dist/template-bindings/color-funcs.js +217 -0
- package/dist/template-bindings/helpers.d.ts +24 -0
- package/dist/template-bindings/helpers.js +48 -0
- package/dist/template-bindings/index.d.ts +107 -0
- package/dist/template-bindings/index.js +146 -0
- package/dist/template-bindings/palette-funcs.d.ts +94 -0
- package/dist/template-bindings/palette-funcs.js +141 -0
- package/dist/template-bindings/style-funcs.d.ts +28 -0
- package/dist/template-bindings/style-funcs.js +155 -0
- package/dist/themes/buildPalette.d.ts +36 -0
- package/dist/themes/buildPalette.js +56 -0
- package/dist/themes/colorMath.d.ts +82 -0
- package/dist/themes/colorMath.js +254 -0
- package/dist/themes/colorRef.d.ts +51 -0
- package/dist/themes/colorRef.js +96 -0
- package/dist/themes/data/ansi-tables.d.ts +14 -0
- package/dist/themes/data/ansi-tables.js +49 -0
- package/dist/themes/data/atom-one-dark.d.ts +3 -0
- package/dist/themes/data/atom-one-dark.js +177 -0
- package/dist/themes/data/atom-one-light.d.ts +3 -0
- package/dist/themes/data/atom-one-light.js +177 -0
- package/dist/themes/data/catppuccin-frappe.d.ts +3 -0
- package/dist/themes/data/catppuccin-frappe.js +177 -0
- package/dist/themes/data/catppuccin-latte.d.ts +3 -0
- package/dist/themes/data/catppuccin-latte.js +177 -0
- package/dist/themes/data/catppuccin-macchiato.d.ts +3 -0
- package/dist/themes/data/catppuccin-macchiato.js +177 -0
- package/dist/themes/data/catppuccin-mocha.d.ts +3 -0
- package/dist/themes/data/catppuccin-mocha.js +177 -0
- package/dist/themes/data/cyberpunk.d.ts +17 -0
- package/dist/themes/data/cyberpunk.js +193 -0
- package/dist/themes/data/default.d.ts +3 -0
- package/dist/themes/data/default.js +160 -0
- package/dist/themes/data/dracula.d.ts +3 -0
- package/dist/themes/data/dracula.js +177 -0
- package/dist/themes/data/flexoki.d.ts +3 -0
- package/dist/themes/data/flexoki.js +177 -0
- package/dist/themes/data/gruvbox.d.ts +3 -0
- package/dist/themes/data/gruvbox.js +177 -0
- package/dist/themes/data/index.d.ts +35 -0
- package/dist/themes/data/index.js +64 -0
- package/dist/themes/data/monokai.d.ts +3 -0
- package/dist/themes/data/monokai.js +177 -0
- package/dist/themes/data/nord.d.ts +3 -0
- package/dist/themes/data/nord.js +177 -0
- package/dist/themes/data/rose-pine-dawn.d.ts +3 -0
- package/dist/themes/data/rose-pine-dawn.js +177 -0
- package/dist/themes/data/rose-pine-moon.d.ts +3 -0
- package/dist/themes/data/rose-pine-moon.js +177 -0
- package/dist/themes/data/rose-pine.d.ts +3 -0
- package/dist/themes/data/rose-pine.js +177 -0
- package/dist/themes/data/solarized-dark.d.ts +3 -0
- package/dist/themes/data/solarized-dark.js +177 -0
- package/dist/themes/data/solarized-light.d.ts +3 -0
- package/dist/themes/data/solarized-light.js +177 -0
- package/dist/themes/data/svg-export.d.ts +3 -0
- package/dist/themes/data/svg-export.js +177 -0
- package/dist/themes/data/textual-ansi.d.ts +3 -0
- package/dist/themes/data/textual-ansi.js +160 -0
- package/dist/themes/data/textual-dark.d.ts +3 -0
- package/dist/themes/data/textual-dark.js +160 -0
- package/dist/themes/data/textual-light.d.ts +3 -0
- package/dist/themes/data/textual-light.js +160 -0
- package/dist/themes/data/tokyo-night.d.ts +3 -0
- package/dist/themes/data/tokyo-night.js +177 -0
- package/dist/themes/data/types.d.ts +31 -0
- package/dist/themes/data/types.js +10 -0
- package/dist/themes/palette.d.ts +21 -0
- package/dist/themes/palette.js +28 -0
- package/dist/themes/ramp.d.ts +83 -0
- package/dist/themes/ramp.js +122 -0
- package/dist/themes/registry.d.ts +44 -0
- package/dist/themes/registry.js +94 -0
- package/dist/themes/terminalThemes.d.ts +49 -0
- package/dist/themes/terminalThemes.js +63 -0
- package/dist/themes/transpose.d.ts +87 -0
- package/dist/themes/transpose.js +138 -0
- package/dist/widgets/button.d.ts +49 -0
- package/dist/widgets/button.js +208 -0
- package/dist/widgets/checkbox.d.ts +41 -0
- package/dist/widgets/checkbox.js +157 -0
- package/dist/widgets/dropdown.d.ts +67 -0
- package/dist/widgets/dropdown.js +450 -0
- package/dist/widgets/event-router.d.ts +71 -0
- package/dist/widgets/event-router.js +629 -0
- package/dist/widgets/focus-manager.d.ts +45 -0
- package/dist/widgets/focus-manager.js +191 -0
- package/dist/widgets/hit.d.ts +64 -0
- package/dist/widgets/hit.js +113 -0
- package/dist/widgets/index.d.ts +20 -0
- package/dist/widgets/index.js +14 -0
- package/dist/widgets/slider.d.ts +57 -0
- package/dist/widgets/slider.js +270 -0
- package/dist/widgets/static-item.d.ts +34 -0
- package/dist/widgets/static-item.js +54 -0
- package/dist/widgets/text-input.d.ts +274 -0
- package/dist/widgets/text-input.js +1165 -0
- package/dist/widgets/toggle.d.ts +44 -0
- package/dist/widgets/toggle.js +180 -0
- package/dist/widgets/types.d.ts +87 -0
- package/dist/widgets/types.js +30 -0
- package/dist/widgets/widget-app.d.ts +63 -0
- package/dist/widgets/widget-app.js +199 -0
- package/dist/widgets/widget-base.d.ts +40 -0
- package/dist/widgets/widget-base.js +165 -0
- package/package.json +6 -2
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ColorDepth, ColorRgba, EIGHT_BIT_DOWNGRADE_TABLE, STANDARD_TABLE, blendRgb, contrastRatio, relativeLuminance, SURFACE_BLACK, } from "../core/color.js";
|
|
2
|
+
import { Oklch } from "../core/oklch.js";
|
|
3
|
+
const LEVEL_STEP = 0.1;
|
|
4
|
+
function rgbToHsl(c) {
|
|
5
|
+
const r = c.red / 255;
|
|
6
|
+
const g = c.green / 255;
|
|
7
|
+
const b = c.blue / 255;
|
|
8
|
+
const max = Math.max(r, g, b);
|
|
9
|
+
const min = Math.min(r, g, b);
|
|
10
|
+
const l = (max + min) / 2;
|
|
11
|
+
const d = max - min;
|
|
12
|
+
if (d === 0)
|
|
13
|
+
return { h: 0, s: 0, l };
|
|
14
|
+
const s = d / (l > 0.5 ? 2 - max - min : max + min);
|
|
15
|
+
let h;
|
|
16
|
+
if (max === r)
|
|
17
|
+
h = ((g - b) / d) % 6;
|
|
18
|
+
else if (max === g)
|
|
19
|
+
h = (b - r) / d + 2;
|
|
20
|
+
else
|
|
21
|
+
h = (r - g) / d + 4;
|
|
22
|
+
h = (h * 60 + 360) % 360;
|
|
23
|
+
return { h, s, l };
|
|
24
|
+
}
|
|
25
|
+
function clampChannel(v) {
|
|
26
|
+
// Float HSL math + Math.round can land at -1 or 256 at the boundaries; clamp
|
|
27
|
+
// so an invalid ColorRgba never escapes this function.
|
|
28
|
+
const r = Math.round(v);
|
|
29
|
+
return r < 0 ? 0 : r > 255 ? 255 : r;
|
|
30
|
+
}
|
|
31
|
+
function hslToRgb(hsl) {
|
|
32
|
+
const { h, s, l } = hsl;
|
|
33
|
+
if (s === 0) {
|
|
34
|
+
const v = clampChannel(l * 255);
|
|
35
|
+
return new ColorRgba(v, v, v);
|
|
36
|
+
}
|
|
37
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
38
|
+
const hp = h / 60;
|
|
39
|
+
const x = c * (1 - Math.abs((hp % 2) - 1));
|
|
40
|
+
let r = 0, g = 0, b = 0;
|
|
41
|
+
if (hp < 1)
|
|
42
|
+
[r, g, b] = [c, x, 0];
|
|
43
|
+
else if (hp < 2)
|
|
44
|
+
[r, g, b] = [x, c, 0];
|
|
45
|
+
else if (hp < 3)
|
|
46
|
+
[r, g, b] = [0, c, x];
|
|
47
|
+
else if (hp < 4)
|
|
48
|
+
[r, g, b] = [0, x, c];
|
|
49
|
+
else if (hp < 5)
|
|
50
|
+
[r, g, b] = [x, 0, c];
|
|
51
|
+
else
|
|
52
|
+
[r, g, b] = [c, 0, x];
|
|
53
|
+
const m = l - c / 2;
|
|
54
|
+
return new ColorRgba(clampChannel((r + m) * 255), clampChannel((g + m) * 255), clampChannel((b + m) * 255));
|
|
55
|
+
}
|
|
56
|
+
function clamp01(v) {
|
|
57
|
+
return v < 0 ? 0 : v > 1 ? 1 : v;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Darken a color by N levels, where each level reduces HSL lightness by 10%.
|
|
61
|
+
* Negative levels lighten. Level 0 returns an equivalent triplet (after the
|
|
62
|
+
* RGB↔HSL roundtrip; values may differ by ±1 due to rounding).
|
|
63
|
+
*/
|
|
64
|
+
export function darken(color, levels) {
|
|
65
|
+
const hsl = rgbToHsl(color);
|
|
66
|
+
hsl.l = clamp01(hsl.l - LEVEL_STEP * levels);
|
|
67
|
+
return hslToRgb(hsl);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Lighten a color by N levels. Equivalent to `darken(color, -levels)`.
|
|
71
|
+
*/
|
|
72
|
+
export function lighten(color, levels) {
|
|
73
|
+
return darken(color, -levels);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Composite `fg` over `bg` with the given alpha (0..1). At alpha=0 returns bg;
|
|
77
|
+
* at alpha=1 returns fg.
|
|
78
|
+
*/
|
|
79
|
+
export function alphaBlend(fg, bg, alpha) {
|
|
80
|
+
return blendRgb(bg, fg, clamp01(alpha));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Pick a contrasting foreground (black or white) for a background, using the
|
|
84
|
+
* WCAG relative-luminance threshold of 0.179 (the perceptually correct cutoff
|
|
85
|
+
* where black and white are equally readable). A translucent `bg` is judged
|
|
86
|
+
* as drawn: composited over `substrate` (see `drawnBackground`).
|
|
87
|
+
*/
|
|
88
|
+
export function contrastFor(bg, substrate = SURFACE_BLACK) {
|
|
89
|
+
const lum = relativeLuminance(drawnBackground(bg, substrate));
|
|
90
|
+
return lum > 0.179
|
|
91
|
+
? new ColorRgba(0, 0, 0)
|
|
92
|
+
: new ColorRgba(255, 255, 255);
|
|
93
|
+
}
|
|
94
|
+
// [LAW:one-way-deps] The WCAG measures live in core/color.ts, beside the
|
|
95
|
+
// ColorTable whose `matchReadable` needs them to pick a drawn text colour, and
|
|
96
|
+
// below the theme math here. Re-exported so this module stays the colour-math
|
|
97
|
+
// surface.
|
|
98
|
+
export { relativeLuminance, contrastRatio };
|
|
99
|
+
// Iterations for the lightness bisection below. 20 resolves L to ~1e-6 — far
|
|
100
|
+
// finer than 8-bit quantization or the eye.
|
|
101
|
+
const CONTRAST_ITERS = 20;
|
|
102
|
+
/**
|
|
103
|
+
* Return a foreground guaranteed to clear `minRatio` against `bg`, keeping the
|
|
104
|
+
* color *recognizably itself*. If the themed `fg` already passes it is returned
|
|
105
|
+
* untouched. Otherwise its OKLCH lightness is slid toward the pole that raises
|
|
106
|
+
* contrast — holding hue, and chroma where it stays in gamut (near the poles
|
|
107
|
+
* gamut clamping may reduce chroma, but hue is preserved) — until the ratio is
|
|
108
|
+
* met, so a blue on a dark-blue background becomes a lighter blue, not white.
|
|
109
|
+
* Only when no lightness of that hue can meet the ratio (a mid-toned
|
|
110
|
+
* background where even pure black-or-white tops out below the target) does it
|
|
111
|
+
* fall back to `contrastFor`'s black/white — the true maximum-contrast pick.
|
|
112
|
+
*
|
|
113
|
+
* A translucent `bg` is measured as it is drawn — composited over
|
|
114
|
+
* `substrate`, the SGR writer's black by default — and a translucent `fg` is
|
|
115
|
+
* then flattened over that drawn background, the order the writer composites
|
|
116
|
+
* in, so the ratio is measured on what the eye actually sees and the returned
|
|
117
|
+
* color is opaque.
|
|
118
|
+
*
|
|
119
|
+
* `drawnAt` is the depth the terminal will draw the pair at. At 256 colours
|
|
120
|
+
* the terminal rounds text and background independently, and two roundings
|
|
121
|
+
* can meet in the middle, so the ratio is measured on the drawn pair: a
|
|
122
|
+
* colour that loses the floor there is replaced by the nearest cube/grey entry
|
|
123
|
+
* that clears it (whose own rounding is itself). At ANSI the terminal draws
|
|
124
|
+
* its own theme's colours, so the ratio is measured on the table's nominal
|
|
125
|
+
* ones (`DRAWN_FROM`): they say which side of the ground text belongs on, and
|
|
126
|
+
* text on its background's index measures 1:1 and is always replaced.
|
|
127
|
+
* Truecolor draws the colour chosen.
|
|
128
|
+
*
|
|
129
|
+
* [LAW:single-enforcer] The one place "is this text readable, and if not fix
|
|
130
|
+
* it" is decided. Callers route every fg/bg pair through here and the
|
|
131
|
+
* unreadable state never reaches output. [LAW:dataflow-not-control-flow] the
|
|
132
|
+
* function always runs; the measured ratio (data) decides how far the
|
|
133
|
+
* lightness moves — there is no caller-side "should I check contrast" branch.
|
|
134
|
+
*/
|
|
135
|
+
export function ensureContrast(fg, bg, minRatio = 4.5, // WCAG AA for normal text
|
|
136
|
+
drawnAt = ColorDepth.TRUECOLOR, substrate = SURFACE_BLACK) {
|
|
137
|
+
const ground = drawnBackground(bg, substrate);
|
|
138
|
+
const chosen = ensureTruecolorContrast(fg, ground, minRatio);
|
|
139
|
+
// [LAW:dataflow-not-control-flow] The depth names the table the terminal
|
|
140
|
+
// draws from; every table is measured the same way.
|
|
141
|
+
const table = DRAWN_FROM[drawnAt];
|
|
142
|
+
if (table === undefined)
|
|
143
|
+
return chosen;
|
|
144
|
+
const drawnBg = drawnColour(ground, drawnAt, substrate);
|
|
145
|
+
if (contrastRatio(drawnColour(chosen, drawnAt, substrate), drawnBg) >= minRatio)
|
|
146
|
+
return chosen;
|
|
147
|
+
return table.get(table.matchReadable(chosen, drawnBg, minRatio));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* `chosen` (composited opaque over `substrate`), or — when the depth the
|
|
151
|
+
* terminal draws at rounds it to a colour `accept` refuses — the nearest colour that depth draws as itself which
|
|
152
|
+
* `accept` takes. `accept` sees the candidate as drawn, and `drawn`, the same
|
|
153
|
+
* rounding for any other colour it measures against, so the caller states a
|
|
154
|
+
* floor once and it holds on the colours the terminal shows — at ANSI, on
|
|
155
|
+
* the table's nominal colours, as `ensureContrast` measures there. Truecolor
|
|
156
|
+
* draws from no table, so a colour refused there has no replacement;
|
|
157
|
+
* `undefined` means nothing the depth draws is accepted.
|
|
158
|
+
*
|
|
159
|
+
* `ensureContrast` is this with a contrast ratio as the floor; this is for a
|
|
160
|
+
* floor that is not text on its background (an open state standing off every
|
|
161
|
+
* closed cell, two planes standing off each other).
|
|
162
|
+
*/
|
|
163
|
+
export function ensureDrawn(chosen, drawnAt, accept, substrate = SURFACE_BLACK) {
|
|
164
|
+
// The floor was measured on `chosen` composited over `substrate`, so that
|
|
165
|
+
// opaque colour is what is returned — never a translucent one a different
|
|
166
|
+
// ground would composite into a colour `accept` never saw.
|
|
167
|
+
const opaque = drawnBackground(chosen, substrate);
|
|
168
|
+
const drawn = (c) => drawnColour(c, drawnAt, substrate);
|
|
169
|
+
if (accept(drawn(opaque), drawn))
|
|
170
|
+
return opaque;
|
|
171
|
+
// [LAW:dataflow-not-control-flow] Truecolor draws from no table, so it has
|
|
172
|
+
// no candidates: a refusal there is `undefined` like any exhausted search.
|
|
173
|
+
const table = DRAWN_FROM[drawnAt];
|
|
174
|
+
const index = table?.matchWhere(opaque, (entry) => accept(entry, drawn));
|
|
175
|
+
return index === undefined ? undefined : table.get(index);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The colour a ground is shown as at `drawnAt`: composited over `substrate`
|
|
179
|
+
* (the SGR writer's black by default), then rounded to the table that depth
|
|
180
|
+
* draws from — at ANSI, that table's nominal colour stands in for the
|
|
181
|
+
* theme's. The one account `ensureDrawn` and `ensureContrast` measure by, for
|
|
182
|
+
* a caller that measures a floor of its own.
|
|
183
|
+
*/
|
|
184
|
+
export function drawnColour(colour, drawnAt, substrate = SURFACE_BLACK) {
|
|
185
|
+
const opaque = drawnBackground(colour, substrate);
|
|
186
|
+
const table = DRAWN_FROM[drawnAt];
|
|
187
|
+
return table === undefined ? opaque : table.get(table.match(opaque));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A background as it is drawn: composited over the surface beneath it. That
|
|
191
|
+
* surface is a fact about where the pair is drawn, so it arrives as a value:
|
|
192
|
+
* the SGR writer (`Style.toSgrCodes`) composites over `SURFACE_BLACK`, the
|
|
193
|
+
* default here; a caller choosing text for a different surface — an export's
|
|
194
|
+
* canvas, `exportCanvas(theme).background` — names that one.
|
|
195
|
+
* [LAW:no-silent-failure] A surface has nothing under it, so a translucent one
|
|
196
|
+
* has no drawn colour to offer; `compositeOver` would read its raw RGB as if
|
|
197
|
+
* it were opaque, so it is refused here rather than measured wrong.
|
|
198
|
+
* [LAW:one-source-of-truth] Text is chosen against the colour the surface will
|
|
199
|
+
* show — measuring the raw RGBA reads a colour that is drawn nowhere, and text
|
|
200
|
+
* that "clears" it can land below the floor. Opaque colours composite to
|
|
201
|
+
* themselves.
|
|
202
|
+
*/
|
|
203
|
+
function drawnBackground(bg, substrate) {
|
|
204
|
+
if (substrate.alpha !== 1) {
|
|
205
|
+
throw new RangeError(`a contrast substrate is the opaque surface under a translucent background; got ${substrate.hex}`);
|
|
206
|
+
}
|
|
207
|
+
return bg.compositeOver(substrate);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The downgrade table the terminal draws from, by depth, measured at each
|
|
211
|
+
* entry's colour. The 256-colour cube and grey ramp are fixed by xterm, so
|
|
212
|
+
* those measurements are exact. ANSI 0–15 are the terminal theme's own, so
|
|
213
|
+
* the table's nominal colours stand in for them: they are wrong in hue from
|
|
214
|
+
* theme to theme, but not about which side of a ground an entry sits on —
|
|
215
|
+
* and two colours on one index are one colour in every theme, which the
|
|
216
|
+
* nominal ratio of 1 refuses. Truecolor draws the chosen colour itself.
|
|
217
|
+
*/
|
|
218
|
+
const DRAWN_FROM = {
|
|
219
|
+
[ColorDepth.EIGHT_BIT]: EIGHT_BIT_DOWNGRADE_TABLE,
|
|
220
|
+
[ColorDepth.STANDARD]: STANDARD_TABLE,
|
|
221
|
+
};
|
|
222
|
+
function ensureTruecolorContrast(fg, bg, minRatio) {
|
|
223
|
+
// Flatten translucency so the guarantee holds for the displayed color, not
|
|
224
|
+
// the raw bytes (e.g. a "#FFFFFF60" text-disabled over a light surface).
|
|
225
|
+
const opaqueFg = fg.compositeOver(bg);
|
|
226
|
+
if (contrastRatio(opaqueFg, bg) >= minRatio)
|
|
227
|
+
return opaqueFg;
|
|
228
|
+
const lab = Oklch.fromRgba(opaqueFg);
|
|
229
|
+
// The pole that increases contrast: lighten toward white on a dark bg, darken
|
|
230
|
+
// toward black on a light one. `contrastFor`'s 0.179 cutoff names it.
|
|
231
|
+
const poleL = relativeLuminance(bg) > 0.179 ? 0 : 1;
|
|
232
|
+
// If even the pole of this hue can't reach the ratio, the hue physically
|
|
233
|
+
// can't — return the true maximum-contrast pick (pure black/white from
|
|
234
|
+
// contrastFor). The gamut-clamped OKLCH pole is only *near* b/w, so
|
|
235
|
+
// contrastFor is at least as strong and is the honest maximum.
|
|
236
|
+
const pole = new Oklch(poleL, lab.c, lab.h, lab.alpha).toRgba();
|
|
237
|
+
if (contrastRatio(pole, bg) < minRatio)
|
|
238
|
+
return contrastFor(bg);
|
|
239
|
+
// Bisect for the lightness nearest the original that still clears the ratio:
|
|
240
|
+
// the smallest perceptual change that achieves accessibility. Contrast is
|
|
241
|
+
// monotone in L over [lab.l, poleL] (everything below the crossing fails),
|
|
242
|
+
// so the search is well-posed.
|
|
243
|
+
let fail = lab.l;
|
|
244
|
+
let pass = poleL;
|
|
245
|
+
for (let i = 0; i < CONTRAST_ITERS; i++) {
|
|
246
|
+
const mid = (fail + pass) / 2;
|
|
247
|
+
const candidate = new Oklch(mid, lab.c, lab.h, lab.alpha).toRgba();
|
|
248
|
+
if (contrastRatio(candidate, bg) >= minRatio)
|
|
249
|
+
pass = mid;
|
|
250
|
+
else
|
|
251
|
+
fail = mid;
|
|
252
|
+
}
|
|
253
|
+
return new Oklch(pass, lab.c, lab.h, lab.alpha).toRgba();
|
|
254
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ColorRgba } from "../core/color.js";
|
|
2
|
+
import type { Palette } from "./palette.js";
|
|
3
|
+
/**
|
|
4
|
+
* A **color reference** is the one string form an author uses to name a
|
|
5
|
+
* concrete color: a palette variable name (`"primary"`, `"surface-active"`,
|
|
6
|
+
* `"text-primary"`) or a literal `#RRGGBB` / `#RRGGBBAA`.
|
|
7
|
+
*
|
|
8
|
+
* [LAW:parse-dont-validate] `resolveColorRef` is the single checkpoint that
|
|
9
|
+
* turns an untrusted reference string into a `ColorRgba`. Everything
|
|
10
|
+
* downstream — color math, `Style` construction, serialization — takes
|
|
11
|
+
* `ColorRgba` and therefore cannot ask again whether the name existed. There
|
|
12
|
+
* is no `isValidColorRef` companion, deliberately: a validator would hand back
|
|
13
|
+
* the same `string` it was given and every consumer would re-check.
|
|
14
|
+
*
|
|
15
|
+
* [LAW:no-silent-failure] A miss throws. An unknown palette name is a broken
|
|
16
|
+
* config, and the author needs to see which name and what was available — not
|
|
17
|
+
* a silently substituted default that makes the bar merely look wrong.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ColorRefError extends Error {
|
|
20
|
+
readonly ref: string;
|
|
21
|
+
constructor(ref: string, detail: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The literal-color shape, exported so the template bindings gate on the same
|
|
25
|
+
* pattern this module parses. [LAW:one-source-of-truth] — one regex, one
|
|
26
|
+
* parser body; the bindings add only their own error wording.
|
|
27
|
+
*/
|
|
28
|
+
export declare const HEX_COLOR_RE: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* Parse a `#RRGGBB` / `#RRGGBBAA` literal. The hex arm of
|
|
31
|
+
* {@link resolveColorRef}, separated so callers that accept *only* literal
|
|
32
|
+
* colors (color math, which cannot meaningfully operate on a palette name)
|
|
33
|
+
* share the one implementation instead of re-deriving it.
|
|
34
|
+
*
|
|
35
|
+
* @throws {ColorRefError} when `hex` is not a well-formed literal.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseHexColor(hex: string): ColorRgba;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a color reference against `palette`.
|
|
40
|
+
*
|
|
41
|
+
* Accepting hex alongside names is what makes this **idempotent**:
|
|
42
|
+
* `resolveColorRef(p, resolveColorRef(p, r).hex)` equals
|
|
43
|
+
* `resolveColorRef(p, r)` for every `r` this function accepts. Callers
|
|
44
|
+
* therefore never branch on "is this a palette name or already a color" —
|
|
45
|
+
* they call it unconditionally on whatever the author wrote, whether that is
|
|
46
|
+
* `"surface-active"` or the output of a chain of color math.
|
|
47
|
+
* [LAW:dataflow-not-control-flow]
|
|
48
|
+
*
|
|
49
|
+
* @throws {ColorRefError} on malformed hex or an unknown palette name.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveColorRef(palette: Palette, ref: string): ColorRgba;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { parseRgbHex, parseRgbaHex } from "../core/color.js";
|
|
2
|
+
/**
|
|
3
|
+
* A **color reference** is the one string form an author uses to name a
|
|
4
|
+
* concrete color: a palette variable name (`"primary"`, `"surface-active"`,
|
|
5
|
+
* `"text-primary"`) or a literal `#RRGGBB` / `#RRGGBBAA`.
|
|
6
|
+
*
|
|
7
|
+
* [LAW:parse-dont-validate] `resolveColorRef` is the single checkpoint that
|
|
8
|
+
* turns an untrusted reference string into a `ColorRgba`. Everything
|
|
9
|
+
* downstream — color math, `Style` construction, serialization — takes
|
|
10
|
+
* `ColorRgba` and therefore cannot ask again whether the name existed. There
|
|
11
|
+
* is no `isValidColorRef` companion, deliberately: a validator would hand back
|
|
12
|
+
* the same `string` it was given and every consumer would re-check.
|
|
13
|
+
*
|
|
14
|
+
* [LAW:no-silent-failure] A miss throws. An unknown palette name is a broken
|
|
15
|
+
* config, and the author needs to see which name and what was available — not
|
|
16
|
+
* a silently substituted default that makes the bar merely look wrong.
|
|
17
|
+
*/
|
|
18
|
+
export class ColorRefError extends Error {
|
|
19
|
+
ref;
|
|
20
|
+
constructor(ref, detail) {
|
|
21
|
+
super(`color reference ${JSON.stringify(ref)} did not resolve — ${detail}`);
|
|
22
|
+
this.ref = ref;
|
|
23
|
+
this.name = "ColorRefError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// A reference *shaped* like hex is resolved as hex; anything else is a palette
|
|
27
|
+
// name. This is a lexical distinction with no overlap — palette variable names
|
|
28
|
+
// never begin with `#` — so it is a parse, not a mode. A `#`-leading string
|
|
29
|
+
// that is malformed hex fails loudly here rather than falling through to a
|
|
30
|
+
// palette lookup that would report a confusing "unknown name" instead of
|
|
31
|
+
// "malformed hex".
|
|
32
|
+
const HEX_LEAD = "#";
|
|
33
|
+
/**
|
|
34
|
+
* The literal-color shape, exported so the template bindings gate on the same
|
|
35
|
+
* pattern this module parses. [LAW:one-source-of-truth] — one regex, one
|
|
36
|
+
* parser body; the bindings add only their own error wording.
|
|
37
|
+
*/
|
|
38
|
+
export const HEX_COLOR_RE = /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/;
|
|
39
|
+
const OPAQUE_HEX_LENGTH = 7; // "#RRGGBB"
|
|
40
|
+
/**
|
|
41
|
+
* Parse a `#RRGGBB` / `#RRGGBBAA` literal. The hex arm of
|
|
42
|
+
* {@link resolveColorRef}, separated so callers that accept *only* literal
|
|
43
|
+
* colors (color math, which cannot meaningfully operate on a palette name)
|
|
44
|
+
* share the one implementation instead of re-deriving it.
|
|
45
|
+
*
|
|
46
|
+
* @throws {ColorRefError} when `hex` is not a well-formed literal.
|
|
47
|
+
*/
|
|
48
|
+
export function parseHexColor(hex) {
|
|
49
|
+
const trimmed = hex.trim();
|
|
50
|
+
if (!HEX_COLOR_RE.test(trimmed)) {
|
|
51
|
+
throw new ColorRefError(hex, "expected #RRGGBB or #RRGGBBAA");
|
|
52
|
+
}
|
|
53
|
+
// Both parsers take the digits without the leading `#`.
|
|
54
|
+
const digits = trimmed.slice(1);
|
|
55
|
+
return trimmed.length > OPAQUE_HEX_LENGTH
|
|
56
|
+
? parseRgbaHex(digits)
|
|
57
|
+
: parseRgbHex(digits);
|
|
58
|
+
}
|
|
59
|
+
// Cap the "did you mean" list. Palettes carry ~150 variables; dumping all of
|
|
60
|
+
// them buries the message. Nearby names are what a mistyped reference needs.
|
|
61
|
+
const SUGGESTION_LIMIT = 8;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve a color reference against `palette`.
|
|
64
|
+
*
|
|
65
|
+
* Accepting hex alongside names is what makes this **idempotent**:
|
|
66
|
+
* `resolveColorRef(p, resolveColorRef(p, r).hex)` equals
|
|
67
|
+
* `resolveColorRef(p, r)` for every `r` this function accepts. Callers
|
|
68
|
+
* therefore never branch on "is this a palette name or already a color" —
|
|
69
|
+
* they call it unconditionally on whatever the author wrote, whether that is
|
|
70
|
+
* `"surface-active"` or the output of a chain of color math.
|
|
71
|
+
* [LAW:dataflow-not-control-flow]
|
|
72
|
+
*
|
|
73
|
+
* @throws {ColorRefError} on malformed hex or an unknown palette name.
|
|
74
|
+
*/
|
|
75
|
+
export function resolveColorRef(palette, ref) {
|
|
76
|
+
const trimmed = ref.trim();
|
|
77
|
+
if (trimmed.startsWith(HEX_LEAD))
|
|
78
|
+
return parseHexColor(trimmed);
|
|
79
|
+
const hit = palette.get(trimmed);
|
|
80
|
+
if (hit === undefined) {
|
|
81
|
+
throw new ColorRefError(ref, `no such variable in palette ${JSON.stringify(palette.name)}` +
|
|
82
|
+
suggest(palette, trimmed));
|
|
83
|
+
}
|
|
84
|
+
return hit;
|
|
85
|
+
}
|
|
86
|
+
// Names sharing a prefix or suffix with the miss — enough to catch the two
|
|
87
|
+
// mistakes that actually happen (a wrong qualifier, `surface-active` vs
|
|
88
|
+
// `surface-lighten`; a wrong root, `text-primary` vs `primary-text`) without
|
|
89
|
+
// printing the whole palette.
|
|
90
|
+
function suggest(palette, miss) {
|
|
91
|
+
const parts = miss.split("-");
|
|
92
|
+
const near = [...palette.vars.keys()]
|
|
93
|
+
.filter((name) => parts.some((part) => part !== "" && name.includes(part)))
|
|
94
|
+
.slice(0, SUGGESTION_LIMIT);
|
|
95
|
+
return near.length === 0 ? "" : `; did you mean: ${near.join(", ")}`;
|
|
96
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AnsiColorsData } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The VGA colours a terminal draws with no theme of its own: Rich's
|
|
4
|
+
* `DEFAULT_TERMINAL_THEME`, and what `textual-ansi` spells its palette in.
|
|
5
|
+
*/
|
|
6
|
+
export declare const VGA_ANSI: AnsiColorsData;
|
|
7
|
+
/**
|
|
8
|
+
* The ANSI tables Textual draws named colours in for a theme that has no
|
|
9
|
+
* terminal scheme of its own: `MONOKAI` under a dark theme and `ALABASTER`
|
|
10
|
+
* under a light one (`ansi_theme_dark` / `ansi_theme_light` in Textual's
|
|
11
|
+
* `app.py`, values from its `_ansi_theme.py`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const TEXTUAL_DARK_ANSI: AnsiColorsData;
|
|
14
|
+
export declare const TEXTUAL_LIGHT_ANSI: AnsiColorsData;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { STANDARD_TABLE } from "../../core/color.js";
|
|
2
|
+
import { ANSI_SLOTS } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The VGA colours a terminal draws with no theme of its own: Rich's
|
|
5
|
+
* `DEFAULT_TERMINAL_THEME`, and what `textual-ansi` spells its palette in.
|
|
6
|
+
*/
|
|
7
|
+
export const VGA_ANSI = Object.fromEntries(ANSI_SLOTS.map((slot, n) => [slot, STANDARD_TABLE.get(n).hex]));
|
|
8
|
+
/**
|
|
9
|
+
* The ANSI tables Textual draws named colours in for a theme that has no
|
|
10
|
+
* terminal scheme of its own: `MONOKAI` under a dark theme and `ALABASTER`
|
|
11
|
+
* under a light one (`ansi_theme_dark` / `ansi_theme_light` in Textual's
|
|
12
|
+
* `app.py`, values from its `_ansi_theme.py`).
|
|
13
|
+
*/
|
|
14
|
+
export const TEXTUAL_DARK_ANSI = {
|
|
15
|
+
black: "#1A1A1A",
|
|
16
|
+
red: "#F4005F",
|
|
17
|
+
green: "#98E024",
|
|
18
|
+
yellow: "#FD971F",
|
|
19
|
+
blue: "#9D65FF",
|
|
20
|
+
magenta: "#F4005F",
|
|
21
|
+
cyan: "#58D1EB",
|
|
22
|
+
white: "#C4C5B5",
|
|
23
|
+
brightBlack: "#625E4C",
|
|
24
|
+
brightRed: "#F4005F",
|
|
25
|
+
brightGreen: "#98E024",
|
|
26
|
+
brightYellow: "#E0D561",
|
|
27
|
+
brightBlue: "#9D65FF",
|
|
28
|
+
brightMagenta: "#F4005F",
|
|
29
|
+
brightCyan: "#58D1EB",
|
|
30
|
+
brightWhite: "#F6F6EF",
|
|
31
|
+
};
|
|
32
|
+
export const TEXTUAL_LIGHT_ANSI = {
|
|
33
|
+
black: "#000000",
|
|
34
|
+
red: "#AA3731",
|
|
35
|
+
green: "#448C27",
|
|
36
|
+
yellow: "#CB9000",
|
|
37
|
+
blue: "#325CC0",
|
|
38
|
+
magenta: "#7A3E9D",
|
|
39
|
+
cyan: "#0083B2",
|
|
40
|
+
white: "#F7F7F7",
|
|
41
|
+
brightBlack: "#777777",
|
|
42
|
+
brightRed: "#F05050",
|
|
43
|
+
brightGreen: "#60CB00",
|
|
44
|
+
brightYellow: "#FFBC5D",
|
|
45
|
+
brightBlue: "#007ACC",
|
|
46
|
+
brightMagenta: "#E64CE6",
|
|
47
|
+
brightCyan: "#00AACB",
|
|
48
|
+
brightWhite: "#F7F7F7",
|
|
49
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
const theme = {
|
|
2
|
+
name: "atom-one-dark",
|
|
3
|
+
dark: true,
|
|
4
|
+
// iTerm2-Color-Schemes "One Half Dark", a terminal port of Atom One
|
|
5
|
+
ansi: {
|
|
6
|
+
black: "#282C34",
|
|
7
|
+
red: "#E06C75",
|
|
8
|
+
green: "#98C379",
|
|
9
|
+
yellow: "#E5C07B",
|
|
10
|
+
blue: "#61AFEF",
|
|
11
|
+
magenta: "#C678DD",
|
|
12
|
+
cyan: "#56B6C2",
|
|
13
|
+
white: "#DCDFE4",
|
|
14
|
+
brightBlack: "#5D677A",
|
|
15
|
+
brightRed: "#E06C75",
|
|
16
|
+
brightGreen: "#98C379",
|
|
17
|
+
brightYellow: "#E5C07B",
|
|
18
|
+
brightBlue: "#61AFEF",
|
|
19
|
+
brightMagenta: "#C678DD",
|
|
20
|
+
brightCyan: "#56B6C2",
|
|
21
|
+
brightWhite: "#DCDFE4",
|
|
22
|
+
},
|
|
23
|
+
vars: {
|
|
24
|
+
"accent": "#A378C2",
|
|
25
|
+
"accent-darken-1": "#8E65AD",
|
|
26
|
+
"accent-darken-2": "#7A5299",
|
|
27
|
+
"accent-darken-3": "#674085",
|
|
28
|
+
"accent-lighten-1": "#B78BD6",
|
|
29
|
+
"accent-lighten-2": "#CC9FEC",
|
|
30
|
+
"accent-lighten-3": "#E2B3FF",
|
|
31
|
+
"accent-muted": "#4C425E",
|
|
32
|
+
"background": "#282C34",
|
|
33
|
+
"background-darken-1": "#181C23",
|
|
34
|
+
"background-darken-2": "#050A14",
|
|
35
|
+
"background-darken-3": "#000000",
|
|
36
|
+
"background-lighten-1": "#383C44",
|
|
37
|
+
"background-lighten-2": "#494D56",
|
|
38
|
+
"background-lighten-3": "#5B5F68",
|
|
39
|
+
"block-cursor-background": "#61AFEF",
|
|
40
|
+
"block-cursor-blurred-background": "#61AFEF4C",
|
|
41
|
+
"block-cursor-blurred-foreground": "#ABB2BF",
|
|
42
|
+
"block-cursor-foreground": "#FFFFFFDD",
|
|
43
|
+
"block-hover-background": "#FFFFFF19",
|
|
44
|
+
"boost": "#FFFFFF0A",
|
|
45
|
+
"boost-darken-1": "#E9E9E90A",
|
|
46
|
+
"boost-darken-2": "#D4D4D40A",
|
|
47
|
+
"boost-darken-3": "#BFBFBF0A",
|
|
48
|
+
"boost-lighten-1": "#FFFFFF0A",
|
|
49
|
+
"boost-lighten-2": "#FFFFFF0A",
|
|
50
|
+
"boost-lighten-3": "#FFFFFF0A",
|
|
51
|
+
"border": "#61AFEF",
|
|
52
|
+
"border-blurred": "#353B47",
|
|
53
|
+
"button-color-foreground": "#FFFFFFDD",
|
|
54
|
+
"button-foreground": "#ABB2BF",
|
|
55
|
+
"error": "#EF6262",
|
|
56
|
+
"error-darken-1": "#D84D50",
|
|
57
|
+
"error-darken-2": "#C1373E",
|
|
58
|
+
"error-darken-3": "#AA1F2E",
|
|
59
|
+
"error-lighten-1": "#FF7674",
|
|
60
|
+
"error-lighten-2": "#FF8B87",
|
|
61
|
+
"error-lighten-3": "#FFA09B",
|
|
62
|
+
"error-muted": "#643C41",
|
|
63
|
+
"footer-background": "#4F5666",
|
|
64
|
+
"footer-description-background": "#00000000",
|
|
65
|
+
"footer-description-foreground": "#ABB2BF",
|
|
66
|
+
"footer-foreground": "#ABB2BF",
|
|
67
|
+
"footer-item-background": "#00000000",
|
|
68
|
+
"footer-key-background": "#00000000",
|
|
69
|
+
"footer-key-foreground": "#A378C2",
|
|
70
|
+
"foreground": "#ABB2BF",
|
|
71
|
+
"foreground-darken-1": "#979DAA",
|
|
72
|
+
"foreground-darken-2": "#838A96",
|
|
73
|
+
"foreground-darken-3": "#707783",
|
|
74
|
+
"foreground-disabled": "#ABB2BF60",
|
|
75
|
+
"foreground-lighten-1": "#BFC6D3",
|
|
76
|
+
"foreground-lighten-2": "#D4DBE8",
|
|
77
|
+
"foreground-lighten-3": "#E9F0FE",
|
|
78
|
+
"foreground-muted": "#ABB2BF99",
|
|
79
|
+
"input-cursor-background": "#ABB2BF",
|
|
80
|
+
"input-cursor-foreground": "#282C34",
|
|
81
|
+
"input-selection-background": "#77C3FF66",
|
|
82
|
+
"link-background": "#00000000",
|
|
83
|
+
"link-background-hover": "#61AFEF",
|
|
84
|
+
"link-color": "#FFFFFFDD",
|
|
85
|
+
"link-color-hover": "#FFFFFFDD",
|
|
86
|
+
"markdown-h1-background": "#00000000",
|
|
87
|
+
"markdown-h1-color": "#61AFEF",
|
|
88
|
+
"markdown-h2-background": "#00000000",
|
|
89
|
+
"markdown-h2-color": "#61AFEF",
|
|
90
|
+
"markdown-h3-background": "#00000000",
|
|
91
|
+
"markdown-h3-color": "#61AFEF",
|
|
92
|
+
"markdown-h4-background": "#00000000",
|
|
93
|
+
"markdown-h4-color": "#ABB2BF",
|
|
94
|
+
"markdown-h5-background": "#00000000",
|
|
95
|
+
"markdown-h5-color": "#ABB2BF",
|
|
96
|
+
"markdown-h6-background": "#00000000",
|
|
97
|
+
"markdown-h6-color": "#ABB2BF99",
|
|
98
|
+
"panel": "#4F5666",
|
|
99
|
+
"panel-darken-1": "#3D4453",
|
|
100
|
+
"panel-darken-2": "#2C3342",
|
|
101
|
+
"panel-darken-3": "#1C2331",
|
|
102
|
+
"panel-lighten-1": "#616878",
|
|
103
|
+
"panel-lighten-2": "#737A8B",
|
|
104
|
+
"panel-lighten-3": "#868E9F",
|
|
105
|
+
"primary": "#61AFEF",
|
|
106
|
+
"primary-background": "#4F5B6A",
|
|
107
|
+
"primary-background-darken-1": "#3F4D5D",
|
|
108
|
+
"primary-background-darken-2": "#303F50",
|
|
109
|
+
"primary-background-darken-3": "#303F50",
|
|
110
|
+
"primary-background-lighten-1": "#5E6A77",
|
|
111
|
+
"primary-background-lighten-2": "#6E7884",
|
|
112
|
+
"primary-background-lighten-3": "#7D8791",
|
|
113
|
+
"primary-darken-1": "#489BD9",
|
|
114
|
+
"primary-darken-2": "#2C87C4",
|
|
115
|
+
"primary-darken-3": "#0074AF",
|
|
116
|
+
"primary-lighten-1": "#77C3FF",
|
|
117
|
+
"primary-lighten-2": "#8ED8FF",
|
|
118
|
+
"primary-lighten-3": "#A4EDFF",
|
|
119
|
+
"primary-muted": "#39536C",
|
|
120
|
+
"scrollbar": "#355674",
|
|
121
|
+
"scrollbar-active": "#61AFEF",
|
|
122
|
+
"scrollbar-background": "#181C23",
|
|
123
|
+
"scrollbar-background-active": "#181C23",
|
|
124
|
+
"scrollbar-background-hover": "#181C23",
|
|
125
|
+
"scrollbar-corner-color": "#181C23",
|
|
126
|
+
"scrollbar-hover": "#3C6589",
|
|
127
|
+
"secondary": "#C678DD",
|
|
128
|
+
"secondary-background": "#5B5567",
|
|
129
|
+
"secondary-background-darken-1": "#4D465A",
|
|
130
|
+
"secondary-background-darken-2": "#3F374D",
|
|
131
|
+
"secondary-background-darken-3": "#3F374D",
|
|
132
|
+
"secondary-background-lighten-1": "#6A6475",
|
|
133
|
+
"secondary-background-lighten-2": "#787382",
|
|
134
|
+
"secondary-background-lighten-3": "#87828F",
|
|
135
|
+
"secondary-darken-1": "#B064C7",
|
|
136
|
+
"secondary-darken-2": "#9B50B3",
|
|
137
|
+
"secondary-darken-3": "#873D9E",
|
|
138
|
+
"secondary-lighten-1": "#DB8CF2",
|
|
139
|
+
"secondary-lighten-2": "#F1A0FF",
|
|
140
|
+
"secondary-lighten-3": "#FFB5FF",
|
|
141
|
+
"secondary-muted": "#574266",
|
|
142
|
+
"success": "#62F062",
|
|
143
|
+
"success-darken-1": "#48DA4D",
|
|
144
|
+
"success-darken-2": "#29C438",
|
|
145
|
+
"success-darken-3": "#00AF22",
|
|
146
|
+
"success-lighten-1": "#7AFF76",
|
|
147
|
+
"success-lighten-2": "#91FF8A",
|
|
148
|
+
"success-lighten-3": "#A8FF9F",
|
|
149
|
+
"success-muted": "#396641",
|
|
150
|
+
"surface": "#3B414D",
|
|
151
|
+
"surface-active": "#484E5B",
|
|
152
|
+
"surface-darken-1": "#2A303B",
|
|
153
|
+
"surface-darken-2": "#1A202B",
|
|
154
|
+
"surface-darken-3": "#09101B",
|
|
155
|
+
"surface-lighten-1": "#4C525E",
|
|
156
|
+
"surface-lighten-2": "#5E6471",
|
|
157
|
+
"surface-lighten-3": "#707684",
|
|
158
|
+
"text": "#FFFFFFDD",
|
|
159
|
+
"text-accent": "#C2A5D6",
|
|
160
|
+
"text-disabled": "#FFFFFF60",
|
|
161
|
+
"text-error": "#F59797",
|
|
162
|
+
"text-muted": "#FFFFFF99",
|
|
163
|
+
"text-primary": "#96CAF4",
|
|
164
|
+
"text-secondary": "#D9A5E8",
|
|
165
|
+
"text-success": "#97F597",
|
|
166
|
+
"text-warning": "#E9CC92",
|
|
167
|
+
"warning": "#DDB25B",
|
|
168
|
+
"warning-darken-1": "#C79D47",
|
|
169
|
+
"warning-darken-2": "#B28A34",
|
|
170
|
+
"warning-darken-3": "#9C7721",
|
|
171
|
+
"warning-lighten-1": "#F4C66E",
|
|
172
|
+
"warning-lighten-2": "#FFDB82",
|
|
173
|
+
"warning-lighten-3": "#FFF096",
|
|
174
|
+
"warning-muted": "#5E543F",
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
export default theme;
|