@adea-ai/themes 0.11.17 → 0.11.18
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/NOTICE +11 -11
- package/README.md +87 -100
- package/dist/accents.d.ts +29 -29
- package/dist/accents.js +28 -28
- package/dist/adapters/base24.d.ts +4 -4
- package/dist/adapters/base24.js +5 -5
- package/dist/adapters/css-variables.d.ts +1 -1
- package/dist/adapters/css-variables.js +1 -1
- package/dist/adapters/css.d.ts +3 -3
- package/dist/adapters/css.js +3 -3
- package/dist/adapters/shadcn.d.ts +7 -7
- package/dist/adapters/shadcn.js +9 -9
- package/dist/adapters/shadcn.js.map +1 -1
- package/dist/adapters/shiki.d.ts +3 -3
- package/dist/adapters/shiki.js +4 -4
- package/dist/adapters/xterm.d.ts +1 -1
- package/dist/adapters/xterm.js +1 -1
- package/dist/catalogue.d.ts +4 -4
- package/dist/catalogue.js +4 -4
- package/dist/derive.d.ts +10 -10
- package/dist/derive.js +14 -14
- package/dist/derive.js.map +1 -1
- package/dist/generated/schemes.d.ts +2 -2
- package/dist/generated/schemes.js +2 -2
- package/dist/normalize.d.ts +9 -9
- package/dist/normalize.js +35 -35
- package/dist/normalize.js.map +1 -1
- package/dist/oklch.d.ts +2 -2
- package/dist/oklch.js +6 -6
- package/dist/oklch.js.map +1 -1
- package/dist/policy.d.ts +3 -3
- package/dist/policy.js +3 -3
- package/dist/schema.d.ts +5 -5
- package/dist/schema.js +4 -4
- package/dist/sources.d.ts +9 -9
- package/dist/sources.js +10 -10
- package/dist/validate.d.ts +8 -8
- package/dist/validate.js +7 -7
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
- package/src/accents.ts +32 -32
- package/src/adapters/base24.ts +5 -5
- package/src/adapters/css-variables.ts +1 -1
- package/src/adapters/css.ts +3 -3
- package/src/adapters/shadcn.ts +9 -9
- package/src/adapters/shiki.ts +4 -4
- package/src/adapters/xterm.ts +1 -1
- package/src/catalogue.ts +4 -4
- package/src/derive.ts +14 -14
- package/src/generated/schemes.ts +2 -2
- package/src/normalize.ts +40 -40
- package/src/oklch.ts +6 -6
- package/src/policy.ts +3 -3
- package/src/schema.ts +5 -5
- package/src/sources.ts +14 -14
- package/src/validate.ts +9 -9
package/dist/derive.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Colours a theme does not store, derived from the ones it does.
|
|
3
3
|
*
|
|
4
|
-
* The canonical schema is deliberately small
|
|
5
|
-
* ANSI colours, a cursor and a selection
|
|
4
|
+
* The canonical schema is deliberately small, seventeen surface roles, sixteen
|
|
5
|
+
* ANSI colours, a cursor and a selection, and three things an application needs
|
|
6
6
|
* are deliberately absent from it: the **syntax roles** a code view wants, the
|
|
7
7
|
* **chart series** a graph wants, and the **fills and foregrounds** a status chip
|
|
8
8
|
* wants.
|
|
9
9
|
*
|
|
10
10
|
* They are absent because each is a *function of* the roles that are present, and a
|
|
11
11
|
* schema that stored them would be a schema with three ways to say the same thing.
|
|
12
|
-
* Deriving them here, once, means every consumer derives them identically
|
|
12
|
+
* Deriving them here, once, means every consumer derives them identically, the
|
|
13
13
|
* alternative, which this replaces, is each application inventing its own mapping
|
|
14
14
|
* and two applications disagreeing about what colour a type is.
|
|
15
15
|
*
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Reading the roles off the sixteen ANSI colours instead has a property worth more
|
|
25
25
|
* than per-theme tuning: the ANSI set is the part of a palette its author *did*
|
|
26
26
|
* choose carefully, every theme in the catalogue has one, and it is already tuned
|
|
27
|
-
* for legibility against that theme's background
|
|
27
|
+
* for legibility against that theme's background, the same requirement a code view
|
|
28
28
|
* has. It is the reasoning that makes `ls --color` readable in each of these
|
|
29
29
|
* palettes today.
|
|
30
30
|
*/
|
|
@@ -38,7 +38,7 @@ export type EditorRole = Exclude<SyntaxRole, 'constant' | 'punctuation'>;
|
|
|
38
38
|
*
|
|
39
39
|
* Comment and punctuation are additionally measured against the canvas: a
|
|
40
40
|
* palette's dim grey is chosen to be read against its *terminal* background, which
|
|
41
|
-
* is the same colour as the canvas here, so the measurement normally passes
|
|
41
|
+
* is the same colour as the canvas here, so the measurement normally passes, but
|
|
42
42
|
* when it does not, the same minimal lightness repair the semantic roles use is
|
|
43
43
|
* applied rather than leaving unreadable comments.
|
|
44
44
|
*/
|
|
@@ -60,8 +60,8 @@ export declare function editorRolesHex(theme: AdeaTheme): Record<EditorRole, str
|
|
|
60
60
|
* Six series, taken in the order that keeps adjacent ones furthest apart on the
|
|
61
61
|
* hue circle: blue, magenta, cyan, green, yellow, red. A palette's own ordering
|
|
62
62
|
* would put red next to green, which is the pair a pie chart most needs to
|
|
63
|
-
* separate. Constant across themes by construction
|
|
64
|
-
* slots
|
|
63
|
+
* separate. Constant across themes by construction, every theme has these six
|
|
64
|
+
* slots, so a chart's series colours mean the same thing in every theme.
|
|
65
65
|
*/
|
|
66
66
|
export declare const CHART_SERIES: readonly (keyof AdeaTheme['ansi'])[];
|
|
67
67
|
/** The chart series for a theme, as OKLCH strings. */
|
|
@@ -71,7 +71,7 @@ export declare function chartSeries(theme: AdeaTheme): readonly string[];
|
|
|
71
71
|
*
|
|
72
72
|
* Status chips need a fill that is the role's colour at low strength, and doing
|
|
73
73
|
* that with alpha would put a translucent colour into a token whose contrast was
|
|
74
|
-
* measured as opaque
|
|
74
|
+
* measured as opaque, and a translucent fill's real contrast depends on whatever
|
|
75
75
|
* happens to be behind it. Blending toward the canvas in OKLCH keeps the result
|
|
76
76
|
* opaque, so the chip's own text pairing can be asserted like any other.
|
|
77
77
|
*/
|
|
@@ -84,11 +84,11 @@ export type StatusRole = (typeof STATUS_ROLES)[number];
|
|
|
84
84
|
*
|
|
85
85
|
* Not the appearance's `foreground`, which is the shortcut and is wrong half the
|
|
86
86
|
* time: a dark theme's foreground is near-white, and near-white on Adea Dark's
|
|
87
|
-
* `success` at `#3fb950` measures 2.6:1
|
|
87
|
+
* `success` at `#3fb950` measures 2.6:1, illegible. The correct answer is
|
|
88
88
|
* whichever of the theme's two extremes measures better against the fill, which
|
|
89
89
|
* for a bright green is black and for a deep red is white.
|
|
90
90
|
*
|
|
91
|
-
* Where neither clears the floor
|
|
91
|
+
* Where neither clears the floor, a mid-tone fill, which some palettes have,
|
|
92
92
|
* the better of the two is returned and {@link validateTheme} is what reports the
|
|
93
93
|
* pairing as failing, rather than a silent blend being substituted here.
|
|
94
94
|
*/
|
package/dist/derive.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Colours a theme does not store, derived from the ones it does.
|
|
3
3
|
*
|
|
4
|
-
* The canonical schema is deliberately small
|
|
5
|
-
* ANSI colours, a cursor and a selection
|
|
4
|
+
* The canonical schema is deliberately small, seventeen surface roles, sixteen
|
|
5
|
+
* ANSI colours, a cursor and a selection, and three things an application needs
|
|
6
6
|
* are deliberately absent from it: the **syntax roles** a code view wants, the
|
|
7
7
|
* **chart series** a graph wants, and the **fills and foregrounds** a status chip
|
|
8
8
|
* wants.
|
|
9
9
|
*
|
|
10
10
|
* They are absent because each is a *function of* the roles that are present, and a
|
|
11
11
|
* schema that stored them would be a schema with three ways to say the same thing.
|
|
12
|
-
* Deriving them here, once, means every consumer derives them identically
|
|
12
|
+
* Deriving them here, once, means every consumer derives them identically, the
|
|
13
13
|
* alternative, which this replaces, is each application inventing its own mapping
|
|
14
14
|
* and two applications disagreeing about what colour a type is.
|
|
15
15
|
*
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Reading the roles off the sixteen ANSI colours instead has a property worth more
|
|
25
25
|
* than per-theme tuning: the ANSI set is the part of a palette its author *did*
|
|
26
26
|
* choose carefully, every theme in the catalogue has one, and it is already tuned
|
|
27
|
-
* for legibility against that theme's background
|
|
27
|
+
* for legibility against that theme's background, the same requirement a code view
|
|
28
28
|
* has. It is the reasoning that makes `ls --color` readable in each of these
|
|
29
29
|
* palettes today.
|
|
30
30
|
*/
|
|
@@ -54,13 +54,13 @@ const EDITOR_ROLES = [
|
|
|
54
54
|
* instead.
|
|
55
55
|
*
|
|
56
56
|
* `variable` and `operator` mean "the ink most of the code is drawn in", and ANSI
|
|
57
|
-
* `white` is that slot *on a dark terminal
|
|
57
|
+
* `white` is that slot *on a dark terminal*, a light grey against a dark canvas.
|
|
58
58
|
* On a light theme the same slot is the terminal's brightest colour, at or near
|
|
59
59
|
* the paper itself, so the mapping hands the editor a foreground it cannot draw
|
|
60
60
|
* with: `editorRolesHex`'s bounded repair could not reach 4.5:1 from a chroma-less
|
|
61
61
|
* near-white within its lightness budget, and every community light theme threw.
|
|
62
62
|
* ANSI `black` is the same "default ink" slot from the paper's side of the
|
|
63
|
-
* palette
|
|
63
|
+
* palette, dark by construction, and it keeps each palette's own tint
|
|
64
64
|
* (Solarized Light's variables stay dark teal, not a repaired grey).
|
|
65
65
|
*/
|
|
66
66
|
const LIGHT_SYNTAX_SOURCE = Object.freeze({
|
|
@@ -100,7 +100,7 @@ const SYNTAX_SOURCE = Object.freeze({
|
|
|
100
100
|
*
|
|
101
101
|
* Comment and punctuation are additionally measured against the canvas: a
|
|
102
102
|
* palette's dim grey is chosen to be read against its *terminal* background, which
|
|
103
|
-
* is the same colour as the canvas here, so the measurement normally passes
|
|
103
|
+
* is the same colour as the canvas here, so the measurement normally passes, but
|
|
104
104
|
* when it does not, the same minimal lightness repair the semantic roles use is
|
|
105
105
|
* applied rather than leaving unreadable comments.
|
|
106
106
|
*/
|
|
@@ -113,7 +113,7 @@ export function syntaxRoles(theme, options = {}) {
|
|
|
113
113
|
* Their whole purpose is to be the faintest thing on screen, and every palette
|
|
114
114
|
* here defines its comment colour that way on purpose: Everforest Light's is
|
|
115
115
|
* 1.9:1 against its own canvas. Holding them to 3:1 could only be satisfied by
|
|
116
|
-
* promoting comments to the body text's colour, which inverts the role
|
|
116
|
+
* promoting comments to the body text's colour, which inverts the role, and the
|
|
117
117
|
* floors that *do* carry text are measured separately and are not relaxed.
|
|
118
118
|
*/
|
|
119
119
|
const floor = options.commentFloor ?? 2;
|
|
@@ -161,7 +161,7 @@ export function editorRolesHex(theme) {
|
|
|
161
161
|
// because a light theme's brightest ANSI slots start near the paper: a
|
|
162
162
|
// pastel yellow `number` has more lightness between it and 4.5:1 than the
|
|
163
163
|
// default budget allows, and this projection's contract is to hold the role
|
|
164
|
-
// to AA however far the lightness has to travel
|
|
164
|
+
// to AA however far the lightness has to travel, darkening a chromatic
|
|
165
165
|
// colour keeps its hue, so the number stays yellow, just amber.
|
|
166
166
|
const repaired = repairToHex(source, background, CONTRAST_FLOORS.text, 0.55);
|
|
167
167
|
if (repaired)
|
|
@@ -175,8 +175,8 @@ export function editorRolesHex(theme) {
|
|
|
175
175
|
* Six series, taken in the order that keeps adjacent ones furthest apart on the
|
|
176
176
|
* hue circle: blue, magenta, cyan, green, yellow, red. A palette's own ordering
|
|
177
177
|
* would put red next to green, which is the pair a pie chart most needs to
|
|
178
|
-
* separate. Constant across themes by construction
|
|
179
|
-
* slots
|
|
178
|
+
* separate. Constant across themes by construction, every theme has these six
|
|
179
|
+
* slots, so a chart's series colours mean the same thing in every theme.
|
|
180
180
|
*/
|
|
181
181
|
export const CHART_SERIES = Object.freeze([
|
|
182
182
|
'blue',
|
|
@@ -195,7 +195,7 @@ export function chartSeries(theme) {
|
|
|
195
195
|
*
|
|
196
196
|
* Status chips need a fill that is the role's colour at low strength, and doing
|
|
197
197
|
* that with alpha would put a translucent colour into a token whose contrast was
|
|
198
|
-
* measured as opaque
|
|
198
|
+
* measured as opaque, and a translucent fill's real contrast depends on whatever
|
|
199
199
|
* happens to be behind it. Blending toward the canvas in OKLCH keeps the result
|
|
200
200
|
* opaque, so the chip's own text pairing can be asserted like any other.
|
|
201
201
|
*/
|
|
@@ -213,11 +213,11 @@ export const STATUS_ROLES = ['success', 'warning', 'error', 'info'];
|
|
|
213
213
|
*
|
|
214
214
|
* Not the appearance's `foreground`, which is the shortcut and is wrong half the
|
|
215
215
|
* time: a dark theme's foreground is near-white, and near-white on Adea Dark's
|
|
216
|
-
* `success` at `#3fb950` measures 2.6:1
|
|
216
|
+
* `success` at `#3fb950` measures 2.6:1, illegible. The correct answer is
|
|
217
217
|
* whichever of the theme's two extremes measures better against the fill, which
|
|
218
218
|
* for a bright green is black and for a deep red is white.
|
|
219
219
|
*
|
|
220
|
-
* Where neither clears the floor
|
|
220
|
+
* Where neither clears the floor, a mid-tone fill, which some palettes have,
|
|
221
221
|
* the better of the two is returned and {@link validateTheme} is what reports the
|
|
222
222
|
* pairing as failing, rather than a silent blend being substituted here.
|
|
223
223
|
*/
|
package/dist/derive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.js","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AA0BjE,MAAM,YAAY,GAAG;IACnB,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,UAAU;IACV,UAAU;IACV,MAAM;IACN,KAAK;IACL,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,SAAS;IACT,YAAY;IACZ,UAAU;IACV,aAAa;CAC2B,CAAA;AAE1C;;;;;;;;;;;;;GAaG;AACH,MAAM,mBAAmB,GACvB,MAAM,CAAC,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE,OAAO;CAClB,CAAC,CAAA;AAEJ,8DAA8D;AAC9D,MAAM,aAAa,GAA0D,MAAM,CAAC,MAAM,CAAC;IACzF,gFAAgF;IAChF,wDAAwD;IACxD,OAAO,EAAE,SAAS;IAClB,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U,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IACxC,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAU,CAAA;AAG5E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAgB,EAAE,IAAgB;IACjE,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3C,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IACtD,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IACtD,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAA;IAEvE,OAAO,WAAW,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;AACrE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,KAAgB,EAAE,IAAgB;IACpE,OAAO,KAAK,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -9,8 +9,8 @@ import type { Base24Scheme } from '../adapters/base24.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* The Base24 schemes as they were vendored, keyed by theme id.
|
|
11
11
|
*
|
|
12
|
-
* Untouched, so a consumer that needs the original bytes
|
|
13
|
-
* licence audit
|
|
12
|
+
* Untouched, so a consumer that needs the original bytes, an interop export, a
|
|
13
|
+
* licence audit, gets them rather than a re-derivation.
|
|
14
14
|
*/
|
|
15
15
|
export declare const generatedSchemes: Readonly<Record<string, Base24Scheme>>;
|
|
16
16
|
//# sourceMappingURL=schemes.d.ts.map
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* The Base24 schemes as they were vendored, keyed by theme id.
|
|
10
10
|
*
|
|
11
|
-
* Untouched, so a consumer that needs the original bytes
|
|
12
|
-
* licence audit
|
|
11
|
+
* Untouched, so a consumer that needs the original bytes, an interop export, a
|
|
12
|
+
* licence audit, gets them rather than a re-derivation.
|
|
13
13
|
*/
|
|
14
14
|
export const generatedSchemes = Object.freeze({
|
|
15
15
|
"aardvark-blue": {
|
package/dist/normalize.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module is the reason the package exists. The palettes in `palettes/` are
|
|
5
5
|
* other people's, and they arrive describing a *terminal*: a background, a
|
|
6
|
-
* foreground, a comment grey, and sixteen hues. A UI needs different words
|
|
6
|
+
* foreground, a comment grey, and sixteen hues. A UI needs different words, a
|
|
7
7
|
* surface ladder, borders, an accent, four status roles that are legible as text.
|
|
8
8
|
* Translating between the two is the work Adea owns, and it is done here, once,
|
|
9
9
|
* for every theme in the catalogue, rather than by hand in each consumer.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* **The surface ladder is built, not read.** Base24 has exactly one background
|
|
14
14
|
* slot, so there is no upstream value to copy for "a card on the canvas". The four
|
|
15
15
|
* rungs are derived by adding fixed increments to the background's OKLCH
|
|
16
|
-
* lightness, keeping its hue and a damped share of its chroma
|
|
16
|
+
* lightness, keeping its hue and a damped share of its chroma, which is what
|
|
17
17
|
* makes Catppuccin's ladder mauve-tinted and Nord's blue-tinted without either
|
|
18
18
|
* being told to be.
|
|
19
19
|
*
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* {@link buildAnsiRamp}.
|
|
32
32
|
*
|
|
33
33
|
* **A selection colour can erase its own text.** Base24's `base02` is whatever the
|
|
34
|
-
* palette's author set, and several set it to a near-white
|
|
34
|
+
* palette's author set, and several set it to a near-white, fine as a terminal
|
|
35
35
|
* selection, fatal as an app selection under near-white body text. The theme keeps
|
|
36
36
|
* the palette's colour and the *adapters* derive a matching foreground
|
|
37
37
|
* (see `adapters/xterm.ts`); the catalogue additionally checks that the selection
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* **Status and accent colours are repaired, within a budget.** A palette chosen for
|
|
41
41
|
* an editor is not automatically legible as UI text. Every status role is checked
|
|
42
42
|
* against the background and its lightness moved by the least amount that clears
|
|
43
|
-
* the floor
|
|
43
|
+
* the floor, and if that would move it more than the budget allows, the theme is
|
|
44
44
|
* reported as failing rather than silently shipping a colour that is no longer the
|
|
45
45
|
* one the palette's author chose.
|
|
46
46
|
*/
|
|
@@ -63,8 +63,8 @@ export interface ThemeSourceSpec {
|
|
|
63
63
|
* Corrections to the vendored palette, applied before anything is derived.
|
|
64
64
|
*
|
|
65
65
|
* A terminal port is not always the project's own palette. Where a port has
|
|
66
|
-
* deliberately changed a value for terminal use
|
|
67
|
-
* darker canvas than Atom's editor did
|
|
66
|
+
* deliberately changed a value for terminal use, iTerm2's One Dark ships a
|
|
67
|
+
* darker canvas than Atom's editor did, the official value is the one Adea
|
|
68
68
|
* should theme with, and the correction is recorded as a finding and documented
|
|
69
69
|
* on the entry that makes it.
|
|
70
70
|
*/
|
|
@@ -84,13 +84,13 @@ export interface ThemeSourceSpec {
|
|
|
84
84
|
*
|
|
85
85
|
* The catalogue holds every palette to WCAG AA on every surface, which is what lets
|
|
86
86
|
* it admit other people's work. The *defaults* are not other people's work: this
|
|
87
|
-
* system holds its own themes to AAA
|
|
87
|
+
* system holds its own themes to AAA, 7:1, because they are what a user sees when
|
|
88
88
|
* they have not chosen anything, and `packages/ui/tests/tokens.test.ts` asserts it.
|
|
89
89
|
*
|
|
90
90
|
* It has to be declared here rather than left to the consumer's test, because the
|
|
91
91
|
* binding pair is text on a *raised* surface: Adea Light's foreground is 7.5:1 on its
|
|
92
92
|
* canvas and 6.2:1 on a popover, since the light ladder descends away from the canvas.
|
|
93
|
-
* Raising the floor rather than lowering the assertion is the point
|
|
93
|
+
* Raising the floor rather than lowering the assertion is the point, the theme is
|
|
94
94
|
* repaired until the claim is true, and the claim stays.
|
|
95
95
|
*/
|
|
96
96
|
textFloor?: number;
|
|
@@ -106,7 +106,7 @@ export interface ThemeSourceSpec {
|
|
|
106
106
|
/**
|
|
107
107
|
* A provenance that overrides the family's.
|
|
108
108
|
*
|
|
109
|
-
* For a theme that is not simply a member of a family
|
|
109
|
+
* For a theme that is not simply a member of a family: Adea's composed dark theme
|
|
110
110
|
* belongs to the `adea` family but has two upstream parents to name.
|
|
111
111
|
*/
|
|
112
112
|
provenance?: ThemeProvenance;
|
package/dist/normalize.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module is the reason the package exists. The palettes in `palettes/` are
|
|
5
5
|
* other people's, and they arrive describing a *terminal*: a background, a
|
|
6
|
-
* foreground, a comment grey, and sixteen hues. A UI needs different words
|
|
6
|
+
* foreground, a comment grey, and sixteen hues. A UI needs different words, a
|
|
7
7
|
* surface ladder, borders, an accent, four status roles that are legible as text.
|
|
8
8
|
* Translating between the two is the work Adea owns, and it is done here, once,
|
|
9
9
|
* for every theme in the catalogue, rather than by hand in each consumer.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* **The surface ladder is built, not read.** Base24 has exactly one background
|
|
14
14
|
* slot, so there is no upstream value to copy for "a card on the canvas". The four
|
|
15
15
|
* rungs are derived by adding fixed increments to the background's OKLCH
|
|
16
|
-
* lightness, keeping its hue and a damped share of its chroma
|
|
16
|
+
* lightness, keeping its hue and a damped share of its chroma, which is what
|
|
17
17
|
* makes Catppuccin's ladder mauve-tinted and Nord's blue-tinted without either
|
|
18
18
|
* being told to be.
|
|
19
19
|
*
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* {@link buildAnsiRamp}.
|
|
32
32
|
*
|
|
33
33
|
* **A selection colour can erase its own text.** Base24's `base02` is whatever the
|
|
34
|
-
* palette's author set, and several set it to a near-white
|
|
34
|
+
* palette's author set, and several set it to a near-white, fine as a terminal
|
|
35
35
|
* selection, fatal as an app selection under near-white body text. The theme keeps
|
|
36
36
|
* the palette's colour and the *adapters* derive a matching foreground
|
|
37
37
|
* (see `adapters/xterm.ts`); the catalogue additionally checks that the selection
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* **Status and accent colours are repaired, within a budget.** A palette chosen for
|
|
41
41
|
* an editor is not automatically legible as UI text. Every status role is checked
|
|
42
42
|
* against the background and its lightness moved by the least amount that clears
|
|
43
|
-
* the floor
|
|
43
|
+
* the floor, and if that would move it more than the budget allows, the theme is
|
|
44
44
|
* reported as failing rather than silently shipping a colour that is no longer the
|
|
45
45
|
* one the palette's author chose.
|
|
46
46
|
*/
|
|
@@ -68,7 +68,7 @@ function distortionOf(attempt) {
|
|
|
68
68
|
* How much stronger body text must be than the secondary rung.
|
|
69
69
|
*
|
|
70
70
|
* Small on purpose. The requirement is that the two are *distinguishable*, not that
|
|
71
|
-
* there is a wide gulf
|
|
71
|
+
* there is a wide gulf, 0.4 of a contrast ratio is a visible difference without
|
|
72
72
|
* making secondary text unnecessarily faint.
|
|
73
73
|
*/
|
|
74
74
|
const MINIMUM_LADDER_GAP = 0.4;
|
|
@@ -94,7 +94,7 @@ function ladderDirection(background) {
|
|
|
94
94
|
* Chroma is scaled up slightly rather than held constant: the steps are small
|
|
95
95
|
* enough that a hue carried at its original chroma reads as a grey smudge, while
|
|
96
96
|
* the same hue with a little more chroma reads as "the tint this theme is made
|
|
97
|
-
* of". The scale is modest because a surface is still a surface
|
|
97
|
+
* of". The scale is modest because a surface is still a surface, at the hover
|
|
98
98
|
* rung a large scale turns a panel into a coloured button.
|
|
99
99
|
*/
|
|
100
100
|
function surfaceRung(background, step, direction) {
|
|
@@ -105,8 +105,8 @@ function surfaceRung(background, step, direction) {
|
|
|
105
105
|
/**
|
|
106
106
|
* Assigns the greyscale ANSI roles.
|
|
107
107
|
*
|
|
108
|
-
* Base24 does not name `black`, `brightBlack`, `white` or `brightWhite
|
|
109
|
-
* background and foreground slots do double duty
|
|
108
|
+
* Base24 does not name `black`, `brightBlack`, `white` or `brightWhite`, the
|
|
109
|
+
* background and foreground slots do double duty, so the mapping is Adea's, and two things about
|
|
110
110
|
* it are not obvious.
|
|
111
111
|
*
|
|
112
112
|
* **It is appearance-aware, because the ANSI greyscale ramp means opposite things
|
|
@@ -117,19 +117,19 @@ function surfaceRung(background, step, direction) {
|
|
|
117
117
|
* **`white` and `brightWhite` are read from different slots per appearance.** On a
|
|
118
118
|
* dark theme they are the two strongest foregrounds, because that is where a dark
|
|
119
119
|
* palette keeps its light colours. On a light theme the foreground ramp is
|
|
120
|
-
* *entirely dark
|
|
121
|
-
* `#3c3836
|
|
120
|
+
* *entirely dark*: Gruvbox Light's `base05`, `base06` and `base07` are all
|
|
121
|
+
* `#3c3836`, so reading "white" off it yields a near-black, and the light colours
|
|
122
122
|
* have to come from the two slots the palette puts *beyond* its canvas, `base10`
|
|
123
123
|
* and `base11`. Where a palette leaves those darker than its canvas, the foreground
|
|
124
124
|
* ramp is used instead.
|
|
125
125
|
*
|
|
126
|
-
* Candidates are de-duplicated first, because light schemes routinely set `base05`, `base06` and `base07` to the same value
|
|
126
|
+
* Candidates are de-duplicated first, because light schemes routinely set `base05`, `base06` and `base07` to the same value, without
|
|
127
127
|
* de-duplication the ramp collapses to three members and the roles collide.
|
|
128
128
|
*/
|
|
129
129
|
function buildAnsiRamp(palette, background, appearance) {
|
|
130
130
|
// Which slots are *foregrounds* depends on the appearance, because Base24's
|
|
131
|
-
// background slots do double duty. `base01` is the "lighter background"
|
|
132
|
-
// status-bar fill
|
|
131
|
+
// background slots do double duty. `base01` is the "lighter background", a
|
|
132
|
+
// status-bar fill, so on a dark scheme it is a usable mid grey and on a light
|
|
133
133
|
// scheme it is a second, barely-darker canvas. `base06` and `base07` are the
|
|
134
134
|
// "light foreground" and "light background", and light schemes routinely set
|
|
135
135
|
// `base07` to the *lightest* background, which ranks as the dimmest member of the
|
|
@@ -170,8 +170,8 @@ function buildAnsiRamp(palette, background, appearance) {
|
|
|
170
170
|
// The two slots a light scheme places beyond its canvas. `base11` is one step
|
|
171
171
|
// further than `base10`, which is what makes it the brighter of the pair.
|
|
172
172
|
//
|
|
173
|
-
// A canvas that is already at the top of the range
|
|
174
|
-
// pure white
|
|
173
|
+
// A canvas that is already at the top of the range: Adea's own light theme is
|
|
174
|
+
// pure white, has nothing beyond it, so the fallback is the *brightest* end of
|
|
175
175
|
// the foreground ramp rather than the darkest. Falling back to the dimmest would
|
|
176
176
|
// hand a light theme an ANSI white darker than its own text.
|
|
177
177
|
const beyondCanvas = [palette.base10, palette.base11].filter((candidate) => candidate.l > background.l);
|
|
@@ -217,7 +217,7 @@ function emit(themeId, role, repair, floor, blended = false) {
|
|
|
217
217
|
* preference order (blue first, because a blue accent is what most of these
|
|
218
218
|
* palettes were designed around) and the first that clears the text floor within
|
|
219
219
|
* budget, while still being *a* colour rather than a grey, wins. A family whose
|
|
220
|
-
* identity lies elsewhere
|
|
220
|
+
* identity lies elsewhere, Everforest is green, Rosé Pine is iris, declares its
|
|
221
221
|
* slot explicitly, and that declaration is honoured before any preference.
|
|
222
222
|
*/
|
|
223
223
|
function chooseAccent(themeId, ansi, surfaces, preferred, anchor) {
|
|
@@ -249,14 +249,14 @@ function chooseAccent(themeId, ansi, surfaces, preferred, anchor) {
|
|
|
249
249
|
if (satisfying.length > 0) {
|
|
250
250
|
// A declared accent is honoured whenever it can be reached without giving the
|
|
251
251
|
// colour up. Lightness movement *is* what a palette author does to make an
|
|
252
|
-
// accent usable
|
|
253
|
-
// still unmistakably iris
|
|
252
|
+
// accent usable: Rosé Pine's iris needs a 0.11 step on its light variant and is
|
|
253
|
+
// still unmistakably iris, so a lightness repair never costs a family its
|
|
254
254
|
// identity. Blending does: past about a third of the way the result stops being
|
|
255
255
|
// the colour it came from, and a green repaired into slate is no longer
|
|
256
256
|
// Everforest's accent.
|
|
257
257
|
//
|
|
258
|
-
// So the declared slot wins unless it had to be blended; if it did
|
|
259
|
-
// was declared
|
|
258
|
+
// So the declared slot wins unless it had to be blended; if it did, or if none
|
|
259
|
+
// was declared, the least-distorted candidate wins, with the preference order
|
|
260
260
|
// breaking ties.
|
|
261
261
|
const cheapest = satisfying.reduce((best, entry) => entry.distortion < best.distortion ? entry : best);
|
|
262
262
|
const declared = preferred ? satisfying.find((entry) => entry.role === preferred) : undefined;
|
|
@@ -370,7 +370,7 @@ function repairAcrossSurfaces(color, surfaces, minimum, budget) {
|
|
|
370
370
|
* toward the palette's own foreground.
|
|
371
371
|
*
|
|
372
372
|
* Everforest Light is why this exists. Its entire palette is muted pastels chosen
|
|
373
|
-
* for a cream canvas, and its brightest accents measure 1.6:1 against that canvas
|
|
373
|
+
* for a cream canvas, and its brightest accents measure 1.6:1 against that canvas,
|
|
374
374
|
* no lightness move fixes that within a budget that leaves the colour recognisable,
|
|
375
375
|
* because the colour is already as dark as its own hue allows. Darkening it further
|
|
376
376
|
* produces olive.
|
|
@@ -378,7 +378,7 @@ function repairAcrossSurfaces(color, surfaces, minimum, budget) {
|
|
|
378
378
|
* Blending toward the palette's foreground instead is what the palette's own author
|
|
379
379
|
* does when they need a colour to be read rather than seen: it keeps the hue, gives
|
|
380
380
|
* up chroma, and converges on the foreground's contrast as the blend approaches 1.
|
|
381
|
-
* The result is a muted, deeper version of the accent
|
|
381
|
+
* The result is a muted, deeper version of the accent, which is what Everforest's
|
|
382
382
|
* light themes actually look like.
|
|
383
383
|
*
|
|
384
384
|
* When even a full blend cannot clear the floor, the theme is reported rather than
|
|
@@ -471,8 +471,8 @@ const NORMAL_HUE_SLOTS = ['base08', 'base0A', 'base0B', 'base0C', 'base0D', 'bas
|
|
|
471
471
|
* against one canvas becomes legible on another.
|
|
472
472
|
*
|
|
473
473
|
* This exists because a composition can put a palette's hues on somebody else's
|
|
474
|
-
* background. GitHub's dark hues measure between 2.5:1 and 4.1:1 on a light canvas
|
|
475
|
-
* fine as accents, unusable as terminal text
|
|
474
|
+
* background. GitHub's dark hues measure between 2.5:1 and 4.1:1 on a light canvas,
|
|
475
|
+
* fine as accents, unusable as terminal text, and repairing each hue *independently*
|
|
476
476
|
* to the floor destroys the thing that makes an ANSI palette an ANSI palette: the
|
|
477
477
|
* bright variants would converge onto their normal siblings, because a bright variant
|
|
478
478
|
* differs from its normal one mainly in lightness and the repair would land them all
|
|
@@ -562,7 +562,7 @@ export function normalizeTheme(source) {
|
|
|
562
562
|
*
|
|
563
563
|
* The interaction rungs are excluded: holding every role to the furthest rung would
|
|
564
564
|
* compress the whole palette for a case that does not occur. Body text *is* drawn
|
|
565
|
-
* on them
|
|
565
|
+
* on them, a hovered or pressed row keeps its label, so once the text and the
|
|
566
566
|
* accent are settled the rungs are fitted to the text instead, in
|
|
567
567
|
* {@link fitInteractionRungs}.
|
|
568
568
|
*/
|
|
@@ -608,14 +608,14 @@ export function normalizeTheme(source) {
|
|
|
608
608
|
if (muted.finding)
|
|
609
609
|
findings.push(muted.finding);
|
|
610
610
|
/*
|
|
611
|
-
* The ladder is derived in order
|
|
611
|
+
* The ladder is derived in order, body, secondary, tertiary, and each rung is
|
|
612
612
|
* held to being dimmer than the one above it.
|
|
613
613
|
*
|
|
614
614
|
* Sourcing the tertiary rung from `base03` is faithful to Base24, which defines that
|
|
615
615
|
* slot as comments and invisibles, and for most palettes it is exactly right: the
|
|
616
616
|
* value the author chose for dim text. But a few publish a `base03` that is not a dim
|
|
617
|
-
* grey at all
|
|
618
|
-
* is a mid slate
|
|
617
|
+
* grey at all: Solarized's light scheme carries its near-black `base03`, Nord Light's
|
|
618
|
+
* is a mid slate, and taking it on trust produced a *tertiary* role that was the
|
|
619
619
|
* most prominent text on the screen, at 13.9:1 against a canvas whose body text
|
|
620
620
|
* measures 5.5:1. So the slot is used when it cooperates and a blend replaces it when
|
|
621
621
|
* it does not, and either way the rung is reported.
|
|
@@ -645,7 +645,7 @@ export function normalizeTheme(source) {
|
|
|
645
645
|
*
|
|
646
646
|
* The secondary rung is repaired against the *raised* surfaces, which is the binding
|
|
647
647
|
* constraint, so on a palette whose foreground is itself only a little above the floor
|
|
648
|
-
* the repair can push secondary text past the body text
|
|
648
|
+
* the repair can push secondary text past the body text: Tokyo Night Day came out
|
|
649
649
|
* with 5.6:1 for a caption and 5.5:1 for the paragraph, which collapses the two roles
|
|
650
650
|
* into one. The fix is to give the body text room rather than to weaken the secondary
|
|
651
651
|
* floor, and it is a small move: the foreground is already above its own floor, so this
|
|
@@ -669,7 +669,7 @@ export function normalizeTheme(source) {
|
|
|
669
669
|
/**
|
|
670
670
|
* The status roles, each with fallback candidates.
|
|
671
671
|
*
|
|
672
|
-
* A palette's yellow is chosen to be *a* yellow, not to be legible as text
|
|
672
|
+
* A palette's yellow is chosen to be *a* yellow, not to be legible as text: Ayu
|
|
673
673
|
* Light's `#ffcc66` measures 1.9:1 on its own near-white canvas, and no amount of
|
|
674
674
|
* lightness repair fixes that without turning it into olive, which is no longer
|
|
675
675
|
* Ayu. So each status role has candidates and takes the first that clears the
|
|
@@ -677,7 +677,7 @@ export function normalizeTheme(source) {
|
|
|
677
677
|
* constants colour and in practice the warning colour this palette already uses;
|
|
678
678
|
* reds and greens fall back to their bright variants.
|
|
679
679
|
*
|
|
680
|
-
* The order is not "brightest first"
|
|
680
|
+
* The order is not "brightest first", on a light canvas the bright variants are
|
|
681
681
|
* worse, so the declared ANSI colour is always tried before its bright sibling.
|
|
682
682
|
*/
|
|
683
683
|
const statusCandidates = {
|
|
@@ -734,14 +734,14 @@ export function normalizeTheme(source) {
|
|
|
734
734
|
*
|
|
735
735
|
* A composition can carry its structure donor's selection explicitly, and taking that
|
|
736
736
|
* on trust once shipped an Adea Light selection measuring 1.11:1 against its own
|
|
737
|
-
* canvas
|
|
737
|
+
* canvas, a donor's deliberately subtle selection is not the same as visible. An
|
|
738
738
|
* invisible selection is a functional defect rather than a matter of taste: the user
|
|
739
739
|
* cannot see what they have selected. So the declared value is used as given and still
|
|
740
740
|
* measured, and moving it is reported.
|
|
741
741
|
*
|
|
742
|
-
* The cursor is deliberately *not* treated this way. It has no floor
|
|
742
|
+
* The cursor is deliberately *not* treated this way. It has no floor, a cursor is an
|
|
743
743
|
* affordance rather than text, and several palettes in the catalogue give it a colour
|
|
744
|
-
* of its own
|
|
744
|
+
* of its own, so the adapters derive a legible glyph for it instead
|
|
745
745
|
* (see `adapters/xterm.ts`).
|
|
746
746
|
*/
|
|
747
747
|
const declaredSelection = source.selection ? parseColor(source.selection) : undefined;
|
|
@@ -792,7 +792,7 @@ const RUNG_FIT_STEP = 0.001;
|
|
|
792
792
|
* The ladder's fixed steps are what make a hover read the same in every theme, and
|
|
793
793
|
* most themes keep them. But a hovered or pressed row is still a row of text, which
|
|
794
794
|
* WCAG holds to the body floor like any other, and a palette whose body text sits
|
|
795
|
-
* close to that floor
|
|
795
|
+
* close to that floor, One Dark's foreground is 6.6:1 on its own canvas, cannot
|
|
796
796
|
* afford the full step: its hover rung measured 4.45:1 and its active rung 3.86:1.
|
|
797
797
|
*
|
|
798
798
|
* So each rung keeps its fixed step unless body text fails on it, and then gives up
|