@promptctl/rich-js 0.28.0 → 0.29.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.
Files changed (162) hide show
  1. package/README.md +7 -7
  2. package/dist/core/animation.d.ts +37 -37
  3. package/dist/core/animation.js +61 -61
  4. package/dist/core/ansi.d.ts +4 -4
  5. package/dist/core/ansi.js +9 -9
  6. package/dist/core/bidi.js +6 -6
  7. package/dist/core/cells.d.ts +1 -1
  8. package/dist/core/cells.js +5 -5
  9. package/dist/core/clock.d.ts +1 -1
  10. package/dist/core/color.d.ts +50 -50
  11. package/dist/core/color.js +69 -69
  12. package/dist/core/console.d.ts +8 -8
  13. package/dist/core/console.js +5 -5
  14. package/dist/core/control-codes.d.ts +3 -3
  15. package/dist/core/control-codes.js +7 -7
  16. package/dist/core/easing.d.ts +40 -40
  17. package/dist/core/easing.js +40 -40
  18. package/dist/core/env.d.ts +1 -1
  19. package/dist/core/env.js +1 -1
  20. package/dist/core/export-html.js +1 -1
  21. package/dist/core/export-lines.d.ts +11 -11
  22. package/dist/core/export-lines.js +12 -12
  23. package/dist/core/export-svg.d.ts +3 -3
  24. package/dist/core/export-svg.js +4 -4
  25. package/dist/core/markup.js +1 -1
  26. package/dist/core/memo.d.ts +1 -1
  27. package/dist/core/memo.js +1 -1
  28. package/dist/core/oklch.d.ts +14 -14
  29. package/dist/core/oklch.js +10 -10
  30. package/dist/core/orient.d.ts +3 -3
  31. package/dist/core/orient.js +3 -3
  32. package/dist/core/paint.d.ts +9 -9
  33. package/dist/core/paint.js +3 -3
  34. package/dist/core/pretty.d.ts +1 -1
  35. package/dist/core/pretty.js +3 -3
  36. package/dist/core/protocol.d.ts +26 -26
  37. package/dist/core/protocol.js +22 -22
  38. package/dist/core/render.d.ts +11 -11
  39. package/dist/core/render.js +12 -12
  40. package/dist/core/segment.d.ts +3 -3
  41. package/dist/core/segment.js +5 -5
  42. package/dist/core/strip.d.ts +83 -83
  43. package/dist/core/strip.js +70 -70
  44. package/dist/core/style.d.ts +20 -20
  45. package/dist/core/style.js +55 -55
  46. package/dist/core/text.d.ts +2 -2
  47. package/dist/core/text.js +5 -5
  48. package/dist/core/timeline.d.ts +5 -5
  49. package/dist/core/timeline.js +9 -9
  50. package/dist/core/tween.d.ts +6 -6
  51. package/dist/core/tween.js +10 -10
  52. package/dist/core/view.d.ts +4 -4
  53. package/dist/core/view.js +12 -12
  54. package/dist/host/app.d.ts +9 -9
  55. package/dist/host/app.js +12 -12
  56. package/dist/host/host-environment.d.ts +2 -2
  57. package/dist/host/host-environment.js +2 -2
  58. package/dist/host/index.d.ts +2 -2
  59. package/dist/host/input.d.ts +7 -7
  60. package/dist/host/input.js +4 -4
  61. package/dist/host/terminal-colors.d.ts +2 -2
  62. package/dist/host/terminal-colors.js +4 -4
  63. package/dist/host/terminal-host.d.ts +2 -2
  64. package/dist/host/terminal-host.js +1 -1
  65. package/dist/index.d.ts +14 -14
  66. package/dist/index.js +10 -10
  67. package/dist/node/prompt.d.ts +1 -1
  68. package/dist/node/prompt.js +1 -1
  69. package/dist/node/terminal-host.d.ts +1 -1
  70. package/dist/node/traceback.js +2 -2
  71. package/dist/renderables/change.js +2 -2
  72. package/dist/renderables/effect.d.ts +39 -39
  73. package/dist/renderables/effect.js +45 -45
  74. package/dist/renderables/effects.d.ts +81 -81
  75. package/dist/renderables/effects.js +157 -157
  76. package/dist/renderables/embed.d.ts +1 -1
  77. package/dist/renderables/embed.js +2 -2
  78. package/dist/renderables/flexStrip.d.ts +7 -7
  79. package/dist/renderables/flexStrip.js +15 -15
  80. package/dist/renderables/frames.d.ts +6 -6
  81. package/dist/renderables/frames.js +11 -11
  82. package/dist/renderables/glyph-effect.d.ts +15 -15
  83. package/dist/renderables/glyph-effect.js +17 -17
  84. package/dist/renderables/glyph-effects.d.ts +7 -7
  85. package/dist/renderables/glyph-effects.js +16 -16
  86. package/dist/renderables/html-entities.d.ts +1 -1
  87. package/dist/renderables/html-entities.js +1 -1
  88. package/dist/renderables/lifecycle.d.ts +4 -4
  89. package/dist/renderables/lifecycle.js +12 -12
  90. package/dist/renderables/live.d.ts +2 -2
  91. package/dist/renderables/live.js +7 -7
  92. package/dist/renderables/markdown-parse.js +3 -3
  93. package/dist/renderables/panel.js +3 -3
  94. package/dist/renderables/progress.d.ts +1 -1
  95. package/dist/renderables/progress.js +1 -1
  96. package/dist/renderables/progressBar.d.ts +1 -1
  97. package/dist/renderables/progressBar.js +6 -6
  98. package/dist/renderables/prompt.d.ts +1 -1
  99. package/dist/renderables/scroll.d.ts +1 -1
  100. package/dist/renderables/scroll.js +3 -3
  101. package/dist/renderables/spinner.d.ts +4 -4
  102. package/dist/renderables/spinner.js +10 -10
  103. package/dist/renderables/syntax.d.ts +2 -2
  104. package/dist/renderables/syntax.js +2 -2
  105. package/dist/renderables/table.js +3 -3
  106. package/dist/renderables/traceback.d.ts +1 -1
  107. package/dist/renderables/traceback.js +1 -1
  108. package/dist/renderables/tree.js +3 -3
  109. package/dist/template-bindings/animation-funcs.d.ts +14 -14
  110. package/dist/template-bindings/animation-funcs.js +27 -27
  111. package/dist/template-bindings/color-funcs.d.ts +14 -14
  112. package/dist/template-bindings/color-funcs.js +25 -25
  113. package/dist/template-bindings/index.d.ts +9 -9
  114. package/dist/template-bindings/index.js +9 -9
  115. package/dist/template-bindings/palette-funcs.d.ts +1 -1
  116. package/dist/template-bindings/palette-funcs.js +3 -3
  117. package/dist/template-bindings/style-funcs.d.ts +5 -5
  118. package/dist/template-bindings/style-funcs.js +16 -16
  119. package/dist/themes/{transpose.d.ts → adjust.d.ts} +23 -23
  120. package/dist/themes/{transpose.js → adjust.js} +28 -28
  121. package/dist/themes/buildPalette.d.ts +3 -3
  122. package/dist/themes/buildPalette.js +20 -20
  123. package/dist/themes/colorMath.d.ts +16 -16
  124. package/dist/themes/colorMath.js +32 -32
  125. package/dist/themes/data/ansi-tables.d.ts +2 -2
  126. package/dist/themes/data/ansi-tables.js +2 -2
  127. package/dist/themes/data/types.d.ts +4 -4
  128. package/dist/themes/data/types.js +2 -2
  129. package/dist/themes/palette.d.ts +12 -12
  130. package/dist/themes/palette.js +16 -16
  131. package/dist/themes/ramp.d.ts +17 -17
  132. package/dist/themes/ramp.js +12 -12
  133. package/dist/themes/registry.js +4 -4
  134. package/dist/themes/terminalThemes.d.ts +1 -1
  135. package/dist/themes/terminalThemes.js +1 -1
  136. package/dist/widgets/button.d.ts +2 -2
  137. package/dist/widgets/button.js +4 -4
  138. package/dist/widgets/checkbox.d.ts +2 -2
  139. package/dist/widgets/checkbox.js +2 -2
  140. package/dist/widgets/dropdown.d.ts +2 -2
  141. package/dist/widgets/dropdown.js +3 -3
  142. package/dist/widgets/event-router.d.ts +6 -6
  143. package/dist/widgets/event-router.js +2 -2
  144. package/dist/widgets/focus-manager.d.ts +3 -3
  145. package/dist/widgets/focus-manager.js +3 -3
  146. package/dist/widgets/index.d.ts +2 -2
  147. package/dist/widgets/index.js +1 -1
  148. package/dist/widgets/ink.d.ts +3 -3
  149. package/dist/widgets/ink.js +4 -4
  150. package/dist/widgets/slider.d.ts +2 -2
  151. package/dist/widgets/static-item.d.ts +2 -2
  152. package/dist/widgets/text-input.d.ts +2 -2
  153. package/dist/widgets/text-input.js +5 -5
  154. package/dist/widgets/themed-widget.js +1 -1
  155. package/dist/widgets/toggle.d.ts +3 -3
  156. package/dist/widgets/toggle.js +3 -3
  157. package/dist/widgets/types.d.ts +6 -6
  158. package/dist/widgets/types.js +2 -2
  159. package/dist/widgets/widget-app.d.ts +10 -10
  160. package/dist/widgets/widget-app.js +8 -8
  161. package/dist/widgets/widget-base.d.ts +2 -2
  162. package/package.json +1 -1
package/dist/core/bidi.js CHANGED
@@ -12,7 +12,7 @@
12
12
  * character the algorithm takes out of the text, which has no level.
13
13
  */
14
14
  import { BIDI_CLASSES, BRACKET_PAIRS, CLASS_RANGES, JOINING_RANGES, JOINING_TYPES, MIRRORS, PRESENTATION_FORMS } from "./bidi-data.js";
15
- import { replaceWithheld } from "./cells.js";
15
+ import { replaceZeroWidth } from "./cells.js";
16
16
  import { pattern } from "./pattern.js";
17
17
  /** The level of a character rule X9 removes. */
18
18
  export const REMOVED = -1;
@@ -69,7 +69,7 @@ export function withoutExplicit(text) {
69
69
  }
70
70
  /** `text` as data on show: what the wire would drop, and every explicit control, spelled by `escape`. */
71
71
  export function escaped(text, escape) {
72
- return replaceWithheld(text, escape).replace(new RegExp(EXPLICIT.source, "gu"), escape);
72
+ return replaceZeroWidth(text, escape).replace(new RegExp(EXPLICIT.source, "gu"), escape);
73
73
  }
74
74
  /** `text` with LRM, RLM and ALM gone. */
75
75
  export function withoutMarks(text) {
@@ -572,12 +572,12 @@ const INITIAL = 2;
572
572
  const MEDIAL = 3;
573
573
  const ZWNJ = "\u200c";
574
574
  const ZWJ = "\u200d";
575
- const UNJOINED = { letter: false, toPrevious: false, toNext: false, joiner: false };
575
+ const UNJOINED = { letter: false, toPrevious: false, toNext: false, separator: false };
576
576
  function joiningOf(cluster) {
577
577
  const base = cluster.codePointAt(0);
578
578
  const type = joiningTypeOf(base);
579
579
  const toNext = (type === "D" || type === "L" || type === "C") && !cluster.includes(ZWNJ);
580
- return { letter: FORMS_OF.has(base), toPrevious: type === "D" || type === "R" || type === "C", toNext, joiner: cluster.includes(ZWJ) };
580
+ return { letter: FORMS_OF.has(base), toPrevious: type === "D" || type === "R" || type === "C", toNext, separator: cluster.includes(ZWJ) };
581
581
  }
582
582
  /**
583
583
  * Arabic joining on one row's grapheme clusters, in logical order and in place:
@@ -605,8 +605,8 @@ export function shaped(clusters) {
605
605
  if (!own.letter)
606
606
  return text;
607
607
  const before = neighbour(at, -1);
608
- const joinsBefore = own.toPrevious && (before.toNext || before.joiner);
609
- const joinsAfter = own.toNext && (own.joiner || neighbour(at, 1).toPrevious);
608
+ const joinsBefore = own.toPrevious && (before.toNext || before.separator);
609
+ const joinsAfter = own.toNext && (own.separator || neighbour(at, 1).toPrevious);
610
610
  const forms = FORMS_OF.get(text.codePointAt(0));
611
611
  const wanted = joinsBefore ? (joinsAfter ? MEDIAL : FINAL) : joinsAfter ? INITIAL : ISOLATED;
612
612
  const form = forms[wanted] || text.codePointAt(0);
@@ -16,7 +16,7 @@
16
16
  * across it would need (UAX #29 GB11). So the width of a string stays the sum over
17
17
  * the clusters of the text as it was given, and every cut stays exact.
18
18
  */
19
- export declare function replaceWithheld(text: string, replacement: (character: string) => string): string;
19
+ export declare function replaceZeroWidth(text: string, replacement: (character: string) => string): string;
20
20
  /** `character` as a Unicode escape a reader can see, for data on show. */
21
21
  export declare function unicodeEscape(character: string): string;
22
22
  /** `text` as the wire may hold it. */
@@ -9,7 +9,7 @@ const cellLenMemo = new Memo();
9
9
  const ZWJ = 0x200d;
10
10
  const ZWJ_CHARACTER = String.fromCodePoint(ZWJ);
11
11
  const VS16 = 0xfe0f;
12
- const JOINERS = pattern(/[\u200d\ufe0f]/);
12
+ const SEPARATOR_STYLES = pattern(/[\u200d\ufe0f]/);
13
13
  const PRINTABLE_ASCII = pattern(/^[ -~]*$/);
14
14
  // Segmented afresh on every call: a cursor's step costs a few microseconds
15
15
  // even in 10k code units, and a cache of segmentations would hold native
@@ -24,7 +24,7 @@ function dispositionCells(codePoint) {
24
24
  case "keep": return codePointWidth(codePoint);
25
25
  case "line-break": return 0;
26
26
  case "pictured": return 0;
27
- case "withheld": return 0;
27
+ case "zeroWidth": return 0;
28
28
  }
29
29
  }
30
30
  const WITHHELD = pattern(new RegExp(controlClass((disposition) => disposition !== "keep"), "u"));
@@ -53,7 +53,7 @@ function selectsAGlyph(text, index) {
53
53
  * across it would need (UAX #29 GB11). So the width of a string stays the sum over
54
54
  * the clusters of the text as it was given, and every cut stays exact.
55
55
  */
56
- export function replaceWithheld(text, replacement) {
56
+ export function replaceZeroWidth(text, replacement) {
57
57
  if (text.match(WITHHELD) === null)
58
58
  return text;
59
59
  const gone = new Set();
@@ -97,7 +97,7 @@ export function unicodeEscape(character) {
97
97
  }
98
98
  /** `text` as the wire may hold it. */
99
99
  export function wireText(text) {
100
- return replaceWithheld(text, () => "");
100
+ return replaceZeroWidth(text, () => "");
101
101
  }
102
102
  // Rich's `cell_len` over a run of text: each code point the cells Rich's table
103
103
  // gives it, but that a ZWJ takes the code point after it into the glyph before
@@ -138,7 +138,7 @@ function measure(text) {
138
138
  if (PRINTABLE_ASCII.test(text))
139
139
  return text.length;
140
140
  const drawn = wireText(text);
141
- if (!JOINERS.test(drawn))
141
+ if (!SEPARATOR_STYLES.test(drawn))
142
142
  return richCells(drawn);
143
143
  let cells = 0;
144
144
  for (const { segment } of SEGMENTER.segment(drawn))
@@ -45,7 +45,7 @@ export interface Clock {
45
45
  /**
46
46
  * Call `tick` once, when this clock reads `time` — as soon as it can for a
47
47
  * time already past — unless the returned function is called first. What
48
- * a host that knows when its frame next changes (`Segment.nextChange`)
48
+ * a host that knows when its frame next changes (`Segment.validUntil`)
49
49
  * waits on. A `time` that is not a finite number of seconds throws; one
50
50
  * further off than a platform timer can wait is waited for in turns.
51
51
  */
@@ -35,12 +35,12 @@ export declare class ColorRgba {
35
35
  compositeOver(bg: ColorRgba): ColorRgba;
36
36
  }
37
37
  /**
38
- * The surface a terminal draws a translucent colour over. A terminal cannot
38
+ * The surface a terminal draws a translucent color over. A terminal cannot
39
39
  * know what lies under its cells, so the SGR writer (`Style.toSgrCodes`), the
40
40
  * exports that picture its output (`resolveLook`), the strip's seam test and
41
41
  * the contrast choosers (`themes/colorMath`) all composite over this one
42
- * colour. [LAW:one-source-of-truth] One constant, so
43
- * the colour text is chosen against is the colour the writer draws.
42
+ * color. [LAW:one-source-of-truth] One constant, so
43
+ * the color text is chosen against is the color the writer draws.
44
44
  */
45
45
  export declare const SURFACE_BLACK: ColorRgba;
46
46
  /**
@@ -64,7 +64,7 @@ export declare function rgbDistance(a: ColorRgba, b: ColorRgba): number;
64
64
  /**
65
65
  * An indexed palette: entry `i` of `colors` is terminal index `firstIndex + i`.
66
66
  * `firstIndex` lets a table hold only the part of a palette a downgrade may
67
- * choose (the 256-colour cube and grey ramp start at 16) while every index it
67
+ * choose (the 256-color cube and grey ramp start at 16) while every index it
68
68
  * reports is the terminal's own.
69
69
  */
70
70
  export declare class ColorTable {
@@ -98,7 +98,7 @@ export declare class ColorTable {
98
98
  private nearestReadable;
99
99
  /**
100
100
  * The nearest entry to `value` (the distance `match` uses) among those
101
- * `accept` takes, given each entry's colour and terminal index; `undefined`
101
+ * `accept` takes, given each entry's color and terminal index; `undefined`
102
102
  * when it takes none. Entries are offered nearest-first (ties to the lower
103
103
  * index) and the first taken wins, so an expensive predicate runs only as
104
104
  * far out as the answer. Uncached: the predicate is the caller's, and a
@@ -126,8 +126,8 @@ declare const COLOR_SYSTEM_DEPTHS: {
126
126
  readonly none: null;
127
127
  };
128
128
  /**
129
- * A colour system by name: `"auto"` detects it from the environment, and each
130
- * other name is a fixed depth — `"none"` no colour. `ColorDepth.WINDOWS` has
129
+ * A color system by name: `"auto"` detects it from the environment, and each
130
+ * other name is a fixed depth — `"none"` no color. `ColorDepth.WINDOWS` has
131
131
  * no name; pass the enum value where a `ColorDepth` is accepted.
132
132
  */
133
133
  export type ColorSystemName = "auto" | keyof typeof COLOR_SYSTEM_DEPTHS;
@@ -145,14 +145,14 @@ export type ColorSystemName = "auto" | keyof typeof COLOR_SYSTEM_DEPTHS;
145
145
  export declare function detectColorSystem(options?: DetectColorOptions): ColorDepth | null;
146
146
  /**
147
147
  * Where segments are written, as everything the serializer (`segmentsToString`)
148
- * needs to know about it: the colour depth SGR is drawn at, whether OSC 8
148
+ * needs to know about it: the color depth SGR is drawn at, whether OSC 8
149
149
  * hyperlinks are emitted, and whether the reader there asked for reduced
150
150
  * motion — under which the terminal's own blink is not asked for
151
151
  * (`shownOn`, `./render.ts`). The serializer takes this value whole, so a
152
152
  * fact the encoding comes to need joins it here rather than the serializer's
153
153
  * signature.
154
154
  */
155
- export interface Destination {
155
+ export interface OutputTarget {
156
156
  readonly colorSystem: ColorDepth | null;
157
157
  readonly hyperlinks: boolean;
158
158
  /**
@@ -165,7 +165,7 @@ export interface Destination {
165
165
  readonly textOrder: TextOrder;
166
166
  }
167
167
  /**
168
- * What `resolveDestination` is told about where it writes beyond the colour
168
+ * What `resolveOutputTarget` is told about where it writes beyond the color
169
169
  * spec: what detection probes, and the reader's preference for motion, which
170
170
  * no spec or terminal reports, so the program hands it in. Absent, everything
171
171
  * moves.
@@ -176,18 +176,18 @@ export interface DestinationOptions extends DetectColorOptions {
176
176
  textOrder?: TextOrder;
177
177
  }
178
178
  /**
179
- * Resolve a colour spec into a `Destination`.
179
+ * Resolve a color spec into an `OutputTarget`.
180
180
  *
181
181
  * [LAW:single-enforcer] The one place a spec becomes both facts. A hyperlink is
182
- * not a colour: an explicit depth — `"none"` and `null` included — states a
183
- * colour choice and keeps links, and under `"auto"` links follow what the
182
+ * not a color: an explicit depth — `"none"` and `null` included — states a
183
+ * color choice and keeps links, and under `"auto"` links follow what the
184
184
  * terminal can take (no TTY, TERM=dumb: none) while NO_COLOR and FORCE_COLOR=0,
185
- * colour preferences, leave them alone. A FORCE_COLOR that forces colour on
185
+ * color preferences, leave them alone. A FORCE_COLOR that forces color on
186
186
  * declares the destination takes escapes, so it keeps links on a pipe too.
187
187
  */
188
- export declare function resolveDestination(spec: ColorSystemName | ColorDepth | null, options?: DestinationOptions): Destination;
188
+ export declare function resolveOutputTarget(spec: ColorSystemName | ColorDepth | null, options?: DestinationOptions): OutputTarget;
189
189
  /**
190
- * Resolve a colour system name into a `ColorDepth` (or `null` for no color).
190
+ * Resolve a color system name into a `ColorDepth` (or `null` for no color).
191
191
  *
192
192
  * `"auto"` triggers env-based detection; every other name is a fixed depth.
193
193
  * A name outside the vocabulary — reachable only from untyped JavaScript —
@@ -208,12 +208,12 @@ export declare class ColorSpec {
208
208
  constructor(name: string, type: ColorDepth, number?: number, value?: ColorRgba);
209
209
  get isDefault(): boolean;
210
210
  /**
211
- * The colour every terminal draws this spec as, where that is fixed — before
211
+ * The color every terminal draws this spec as, where that is fixed — before
212
212
  * any alpha is flattened, so a translucent value is drawn composited over
213
213
  * its ground (`flattenAlpha`) and should be measured that way: a
214
- * truecolor value, or a 256-colour cube or grey-ramp entry (xterm fixes
214
+ * truecolor value, or a 256-color cube or grey-ramp entry (xterm fixes
215
215
  * indices 16–255, and `fromAnsi` types only those as EIGHT_BIT). ANSI 0–15,
216
- * the default colour and a blend reaching either are the terminal theme's
216
+ * the default color and a blend reaching either are the terminal theme's
217
217
  * own, so they have none.
218
218
  */
219
219
  get fixedValue(): ColorRgba | undefined;
@@ -250,48 +250,48 @@ export declare class ColorSpec {
250
250
  static fromRgba(value: ColorRgba): ColorSpec;
251
251
  static fromRgb(r: number, g: number, b: number): ColorSpec;
252
252
  /**
253
- * The colour `t` of the way from `from` to `to`: what `blend(from,to,t)`
254
- * parses to. Two fixed colours mix to a fixed colour. A mix reaching a
255
- * theme's own colour stays a mix until it is drawn, so whatever theme draws
253
+ * The color `t` of the way from `from` to `to`: what `blend(from,to,t)`
254
+ * parses to. Two fixed colors mix to a fixed color. A mix reaching a
255
+ * theme's own color stays a mix until it is drawn, so whatever theme draws
256
256
  * an end draws the mix from it: exported under a theme whose `blue` is
257
257
  * #61afef, a mix with `blue` starts from #61afef. A terminal is told its RGB
258
258
  * under the standard table, the only one a render has.
259
259
  *
260
- * Each end is one opaque colour: `default` is no colour to mix, and a
260
+ * Each end is one opaque color: `default` is no color to mix, and a
261
261
  * translucent end has no one shade until it is laid on a ground.
262
262
  */
263
263
  static blend(from: ColorSpec, to: ColorSpec, t: number): ColorSpec;
264
264
  /**
265
265
  * The spec that draws `value` nearest to it at `depth` on a terminal known
266
- * to show `theme`, as the colour of the glyph (`foreground`) or of the
266
+ * to show `theme`, as the color of the glyph (`foreground`) or of the
267
267
  * ground. Where `downgrade` knows no terminal, and so rounds only against
268
- * colours every terminal fixes (or, at sixteen colours, the stock
269
- * sixteen), this rounds against every colour the depth can write whose
270
- * look `theme` fixes: the default colour, the theme's sixteen, and at 256
271
- * colours the cube and grey ramp too. A colour read off any of those and
272
- * moved a little is drawn as the colour it came from — or, where the theme
273
- * gives two slots one colour, as the lower slot, which looks the same.
268
+ * colors every terminal fixes (or, at sixteen colors, the stock
269
+ * sixteen), this rounds against every color the depth can write whose
270
+ * look `theme` fixes: the default color, the theme's sixteen, and at 256
271
+ * colors the cube and grey ramp too. A color read off any of those and
272
+ * moved a little is drawn as the color it came from — or, where the theme
273
+ * gives two slots one color, as the lower slot, which looks the same.
274
274
  *
275
- * `value` is opaque: a translucent colour has no one look until it is laid
275
+ * `value` is opaque: a translucent color has no one look until it is laid
276
276
  * on a ground (`flattenAlpha`).
277
277
  */
278
278
  static matchOn(value: ColorRgba, depth: ColorDepth, theme: TerminalColors, foreground: boolean): ColorSpec;
279
279
  /**
280
- * Every colour `depth` writes by index, each with the colour a terminal
280
+ * Every color `depth` writes by index, each with the color a terminal
281
281
  * known to show `theme` draws it in, lowest index first: the theme's
282
- * sixteen, and at 256 colours the cube and grey ramp after them. Each is
283
- * drawn alike as glyph and as ground, which the default colour is not, so
284
- * it is not among them. Truecolor writes a colour itself and the default
285
- * depth only the default, so neither writes any by index. The colours
282
+ * sixteen, and at 256 colors the cube and grey ramp after them. Each is
283
+ * drawn alike as glyph and as ground, which the default color is not, so
284
+ * it is not among them. Truecolor writes a color itself and the default
285
+ * depth only the default, so neither writes any by index. The colors
286
286
  * `matchOn` rounds to, but for the default, read off the same two tables.
287
287
  */
288
288
  static indexed(depth: ColorDepth, theme: TerminalColors): readonly (readonly [ColorSpec, ColorRgba])[];
289
289
  /**
290
- * The spec a slot is written in once its colour moves from `was`, what its
290
+ * The spec a slot is written in once its color moves from `was`, what its
291
291
  * written spec draws on `theme`, to the opaque `now`: `matchOn`'s — or
292
292
  * none, where the written spec is as near `now` as that match. A move the
293
- * depth cannot show is no move, so below truecolor a colour moved a little
294
- * off any colour the depth can write — a theme slot, the default colour,
293
+ * depth cannot show is no move, so below truecolor a color moved a little
294
+ * off any color the depth can write — a theme slot, the default color,
295
295
  * the cube — keeps the spec it was written in.
296
296
  */
297
297
  static matchMove(was: ColorRgba, now: ColorRgba, depth: ColorDepth, theme: TerminalColors, foreground: boolean): ColorSpec | undefined;
@@ -302,7 +302,7 @@ export declare class ColorSpec {
302
302
  static parse(colorString: string): ColorSpec;
303
303
  private performDowngrade;
304
304
  }
305
- /** Six hex digits, no `#`, as an opaque colour. @throws {ColorParseError} on anything else. */
305
+ /** Six hex digits, no `#`, as an opaque color. @throws {ColorParseError} on anything else. */
306
306
  export declare function parseRgbHex(hex: string): ColorRgba;
307
307
  /** Eight hex digits, no `#`, the last pair alpha. @throws {ColorParseError} on anything else. */
308
308
  export declare function parseRgbaHex(hex: string): ColorRgba;
@@ -313,7 +313,7 @@ export declare function parseRgbaHex(hex: string): ColorRgba;
313
313
  export declare function parseHexColor(literal: string): ColorRgba;
314
314
  export declare function blendRgb(color1: ColorRgba, color2: ColorRgba, crossFade?: number): ColorRgba;
315
315
  /**
316
- * What a terminal draws with: the part of a `TerminalTheme` a colour resolves
316
+ * What a terminal draws with: the part of a `TerminalTheme` a color resolves
317
317
  * against.
318
318
  */
319
319
  export declare class TerminalColors {
@@ -324,12 +324,12 @@ export declare class TerminalColors {
324
324
  constructor(backgroundColor: ColorRgba, foregroundColor: ColorRgba, ansiColors: ColorTable);
325
325
  }
326
326
  /**
327
- * A terminal theme — surface/foreground baseline, the sixteen ANSI colours,
327
+ * A terminal theme — surface/foreground baseline, the sixteen ANSI colors,
328
328
  * and a semantic palette.
329
329
  *
330
- * **`ansiColors` is the theme's own sixteen colours**, the shades a terminal
330
+ * **`ansiColors` is the theme's own sixteen colors**, the shades a terminal
331
331
  * showing this theme draws `red`, `blue` and the rest in. `ColorSpec.parse("red")`
332
- * is ANSI colour 1 under every theme; which red that is, is the theme's to say,
332
+ * is ANSI color 1 under every theme; which red that is, is the theme's to say,
333
333
  * as it is in Rich, where each `TerminalTheme` carries its own table.
334
334
  */
335
335
  export declare class TerminalTheme extends TerminalColors {
@@ -339,15 +339,15 @@ export declare class TerminalTheme extends TerminalColors {
339
339
  export declare const STANDARD_TABLE: ColorTable;
340
340
  export declare const EIGHT_BIT_TABLE: ColorTable;
341
341
  /**
342
- * What a downgrade to 256 colours may choose: the cube and the grey ramp,
343
- * indices 16–255. Indices 0–15 are the terminal's own ANSI colours, which
342
+ * What a downgrade to 256 colors may choose: the cube and the grey ramp,
343
+ * indices 16–255. Indices 0–15 are the terminal's own ANSI colors, which
344
344
  * every theme redefines, so their RGB is unknown and a match against them is
345
345
  * a guess; Python Rich never picks them either.
346
346
  */
347
347
  export declare const EIGHT_BIT_DOWNGRADE_TABLE: ColorTable;
348
348
  export declare const WINDOWS_TABLE: ColorTable;
349
349
  /**
350
- * The terminal a colour at `depth` is drawn by: `theme`, or when a caller names
350
+ * The terminal a color at `depth` is drawn by: `theme`, or when a caller names
351
351
  * none, the one the depth assumes — the Windows console at WINDOWS, the VGA
352
352
  * sixteen otherwise — for `ColorSpec.getTruecolor` and the contrast measurement
353
353
  * that reads it. (Widgets fall back to `DEFAULT_TERMINAL_THEME`, which carries a
@@ -355,9 +355,9 @@ export declare const WINDOWS_TABLE: ColorTable;
355
355
  */
356
356
  export declare function resolveTerminal(theme: TerminalColors | undefined, depth: ColorDepth): TerminalColors;
357
357
  /**
358
- * The table a downgrade to `depth` rounds a fixed colour against.
359
- * [LAW:one-source-of-truth] `ColorSpec.downgrade` picks the index a colour is
360
- * written as from it, and colorMath hands back its entries as colours the
358
+ * The table a downgrade to `depth` rounds a fixed color against.
359
+ * [LAW:one-source-of-truth] `ColorSpec.downgrade` picks the index a color is
360
+ * written as from it, and colorMath hands back its entries as colors the
361
361
  * writer rounds to those same indices.
362
362
  */
363
363
  export declare function downgradeTable(depth: ColorDepth.EIGHT_BIT | ColorDepth.STANDARD | ColorDepth.WINDOWS): ColorTable;