Skip to main content

Color

Enum Color 

Source
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.

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

Source

pub fn as_str(&self) -> Option<&str>

The wire name of a known token, or None for Color::Other.

Source

pub fn parse(name: &str) -> Self

Parses a known token; unknown names become Color::Other.

Source

pub fn is_unknown(&self) -> bool

True when this is Color::Other (not a known token).

Trait Implementations§

Source§

impl Clone for Color

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Color

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Color

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Color

Source§

impl Hash for Color

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Color

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Color

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

impl Freeze for Color

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnsafeUnpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.