@@ -815,42 +815,41 @@ color; the terminal applies its own theme when it draws the cell.
815815| ` HighlightText ` , ` SelectedItemText ` | palette 15 (bright white) |
816816| ` MarkText ` , ` AccentColorText ` | palette 0 (black) |
817817
818- Each default keyword names the terminal default color of one specific
819- attribute: ` Canvas ` , ` ButtonFace ` , and ` Field ` name the default background;
820- ` CanvasText ` , ` ButtonText ` , and ` FieldText ` name the default foreground.
821- ** Used in its own field** — a background-default keyword in a background
822- field ( ` open({ bg }) ` , ` text({ bg }) ` , ` border.bg ` , a border side's ` bg ` ), or
823- a foreground-default keyword in a foreground field (` text({ color }) ` ,
824- ` border.color ` , a border side's ` color ` ) — it resolves to that field's
825- terminal default, unchanged from the table above.
818+ Each default keyword names the terminal default color of one specific attribute:
819+ ` Canvas ` , ` ButtonFace ` , and ` Field ` name the default background; ` CanvasText ` ,
820+ ` ButtonText ` , and ` FieldText ` name the default foreground. ** Used in its own
821+ field** — a background-default keyword in a background field ( ` open({ bg }) ` ,
822+ ` text({ bg }) ` , ` border.bg ` , a border side's ` bg ` ), or a foreground-default
823+ keyword in a foreground field (` text({ color }) ` , ` border.color ` , a border
824+ side's ` color ` ) — it resolves to that field's terminal default, unchanged from
825+ the table above.
826826
827827** Used in the other field** — a foreground-default keyword in a background
828- field, or a background-default keyword in a foreground field, including a
829- border side's ` color ` — it resolves to the terminal's probed color for the
830- attribute it names, not to that field's default. The renderer reads this from
831- the OSC 10/11 theme probe, surfaced as ` RuntimeCapabilities.theme.foreground `
832- / ` .background ` (terminfo-spec §6.4) and passed into ` pack() ` as the theme
833- snapshot ` term.render() ` holds at render time (§12.5). The result is an
834- ordinary opaque sRGB color (alpha 255): it packs exactly like the equivalent
835- ` rgba() ` value, renders as truecolor, and transitions interpolate it like any
836- other RGB color — unlike the terminal-themed colors described below. When the
837- theme has not yet reported that color, the keyword falls back to its field's
838- own terminal default instead (the same-field behavior above). A theme report
839- that arrives after a frame renders takes effect starting with the next
840- render.
828+ field, or a background-default keyword in a foreground field, including a border
829+ side's ` color ` — it resolves to the terminal's probed color for the attribute it
830+ names, not to that field's default. The renderer reads this from the OSC 10/11
831+ theme probe, surfaced as ` RuntimeCapabilities.theme.foreground ` / ` .background `
832+ (terminfo-spec §6.4) and passed into ` pack() ` as the theme snapshot
833+ ` term.render() ` holds at render time (§12.5). The result is an ordinary opaque
834+ sRGB color (alpha 255): it packs exactly like the equivalent ` rgba() ` value,
835+ renders as truecolor, and transitions interpolate it like any other RGB color —
836+ unlike the terminal-themed colors described below. When the theme has not yet
837+ reported that color, the keyword falls back to its field's own terminal default
838+ instead (the same-field behavior above). A theme report that arrives after a
839+ frame renders takes effect starting with the next render.
841840
842841For example, once the terminal has reported its default foreground color,
843842` text({ bg: "CanvasText" }) ` paints that color as an opaque truecolor
844843background. Until then it falls back to the default background: a terminal
845- offers no way to paint its default foreground color as a cell background
846- without knowing its RGB value, and the renderer never guesses one.
844+ offers no way to paint its default foreground color as a cell background without
845+ knowing its RGB value, and the renderer never guesses one.
847846
848- A terminal-themed color (a same-field default, or a palette entry) is opaque.
849- A palette color in a foreground field is emitted as SGR ` 30 ` –` 37 ` for palette
850- 0–7 and ` 90 ` –` 97 ` for palette 8–15; in a background field, as SGR ` 40 ` –` 47 `
851- and ` 100 ` –` 107 ` . A terminal default color is emitted as SGR ` 39 ` (foreground)
852- or ` 49 ` (background), or by omitting the foreground or background SGR after
853- an SGR reset, which leaves the same default in effect.
847+ A terminal-themed color (a same-field default, or a palette entry) is opaque. A
848+ palette color in a foreground field is emitted as SGR ` 30 ` –` 37 ` for palette 0–7
849+ and ` 90 ` –` 97 ` for palette 8–15; in a background field, as SGR ` 40 ` –` 47 ` and
850+ ` 100 ` –` 107 ` . A terminal default color is emitted as SGR ` 39 ` (foreground) or
851+ ` 49 ` (background), or by omitting the foreground or background SGR after an SGR
852+ reset, which leaves the same default in effect.
854853
855854A terminal default background is a color, not the absence of one. An explicit
856855` Canvas ` background (or ` ButtonFace ` , ` Field ` , or any default keyword in a
@@ -1368,11 +1367,11 @@ Exported and used in tests.
13681367serializes a directive array into the transfer encoding described in Section
1369136812.1. Currently exported but not public API; its exposure is incidental to the
13701369module structure. The optional trailing ` theme ` carries the probed default
1371- foreground/background colors (` RuntimeCapabilities.theme ` , terminfo-spec
1372- §6.4), used to resolve a cross-field default keyword (§8.5) to the terminal's
1373- actual default color. ` term.render() ` passes its current capability
1374- snapshot's ` theme ` ; a caller that omits it gets the field-default fallback for
1375- every cross-field keyword.
1370+ foreground/background colors (` RuntimeCapabilities.theme ` , terminfo-spec §6.4),
1371+ used to resolve a cross-field default keyword (§8.5) to the terminal's actual
1372+ default color. ` term.render() ` passes its current capability snapshot's ` theme ` ;
1373+ a caller that omits it gets the field-default fallback for every cross-field
1374+ keyword.
13761375
13771376---
13781377
0 commit comments