std:text/ColorMode
std:text/ColorMode
Section titled “std:text/ColorMode”Canonical occurrence:
protos/lib/text/ColorMode.protos· Protos revision:e99b712ecf658a527b1fe82c8beba2c1286d8dc9.
Reusable color-mode policy. The three modes are AUTO, ALWAYS, and
NEVER. Each mode is its canonical String value: ColorMode.AUTO is
exactly "AUTO", so a mode is immutable, compares with === and ==, and
keeps its identity across Actor, Task, and Process boundaries without any
shared registry. No other spelling, alias, or letter case is a mode.
Resolution is pure policy: it consults no environment, Process, standard
stream, terminal, or global configuration. Whether AUTO enables styling
is decided entirely by the caller, which supplies that Boolean to resolve
and passes the resolved Boolean to a renderer such as std:text/ANSI.
Observable top-level slots
Section titled “Observable top-level slots”This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.
ALWAYS
Section titled “ALWAYS”Styling is always enabled.
Mechanical facts
Section titled “Mechanical facts”No callable shape is mechanically recorded for this slot.
- Source occurrence:
protos/lib/text/ColorMode.protos:31 - Exact source page: open in the source browser
Styling follows the caller-supplied automatic decision.
Mechanical facts
Section titled “Mechanical facts”No callable shape is mechanically recorded for this slot.
- Source occurrence:
protos/lib/text/ColorMode.protos:28 - Exact source page: open in the source browser
Styling is never enabled.
Mechanical facts
Section titled “Mechanical facts”No callable shape is mechanically recorded for this slot.
- Source occurrence:
protos/lib/text/ColorMode.protos:34 - Exact source page: open in the source browser
recognizes
Section titled “recognizes”Answers true exactly when value is one of the canonical modes and
false for any other value; it never signals an Error. Values are
recognized by String identity only, so no behavior of value is invoked.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
value -
Rest parameter: none
-
Source occurrence:
protos/lib/text/ColorMode.protos:39 -
Exact source page: open in the source browser
resolve
Section titled “resolve”Answers whether styling is enabled under mode: AUTO answers
autoEnabled, ALWAYS answers true, and NEVER answers false.
Both arguments are always validated, whatever the mode: mode must be a
canonical mode and autoEnabled must be exactly true or false; any
other argument signals an Error, and no argument is converted. No
environment or terminal is consulted to decide AUTO.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
mode,autoEnabled -
Rest parameter: none
-
Source occurrence:
protos/lib/text/ColorMode.protos:49 -
Exact source page: open in the source browser
Exact module source · Standard-library API · Standard library overview