pub enum Color {
Show 45 variants
Reset,
Text,
Muted,
Dim,
Accent,
Primary,
Info,
Link,
Success,
Warning,
Error,
Harness,
Thinking,
Tool,
User,
Assistant,
Code,
Border,
BorderAccent,
BorderMuted,
C1,
C2,
C3,
C4,
C5,
C6,
C7,
C8,
C9,
C10,
C11,
C12,
Surface1,
Surface2,
Surface3,
SelectedBg,
SuccessBg,
ErrorBg,
WarningBg,
InfoBg,
AccentBg,
DiffAdded,
DiffRemoved,
DiffContext,
Other(String),
}Expand description
Theme role token (ui-protocol v2 §5). The closed set of tokens plus Color::Other
for tolerant parsing of unknown names.
Variants§
Reset
Clear inherited colour / terminal default.
Text
Body text.
Muted
Secondary text.
Dim
Hints, timestamps.
Accent
Highlights, active marks (claw orange in the app).
Primary
Primary action, focus (shell red; never for errors).
Info
Information, links.
Link
Alias of Color::Info (links).
Success
Done, ok.
Warning
Warnings.
Error
Errors.
Harness
Harness / provenance rails.
Thinking
Thinking text.
Tool
Tool titles.
User
Message-role tint (user).
Assistant
Message-role tint (assistant).
Code
Inline code.
Border
Borders.
BorderAccent
Focused / accent borders.
BorderMuted
Quiet borders.
C1
Categorical palette slots 1..12.
C2
Categorical palette slots 1..12.
C3
Categorical palette slots 1..12.
C4
Categorical palette slots 1..12.
C5
Categorical palette slots 1..12.
C6
Categorical palette slots 1..12.
C7
Categorical palette slots 1..12.
C8
Categorical palette slots 1..12.
C9
Categorical palette slots 1..12.
C10
Categorical palette slots 1..12.
C11
Categorical palette slots 1..12.
C12
Categorical palette slots 1..12.
Surface1
Panels, inputs.
Surface2
Panels, inputs.
Surface3
Selection.
SelectedBg
Selected rows.
SuccessBg
Tinted rows (success).
ErrorBg
Tinted rows (error).
WarningBg
Tinted rows (warning).
InfoBg
Tinted rows (info).
AccentBg
Tinted rows (accent).
DiffAdded
Diff-like added text.
DiffRemoved
Diff-like removed text.
DiffContext
Diff-like context text.
Other(String)
Unknown token: renderers drop it (with a diagnostic) instead of rejecting (§4.8).
Implementations§
Source§impl Color
impl Color
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
The wire name of a known token, or None for Color::Other.
Sourcepub fn parse(name: &str) -> Self
pub fn parse(name: &str) -> Self
Parses a known token; unknown names become Color::Other.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
True when this is Color::Other (not a known token).