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