Skip to main content

ColorScheme

Struct ColorScheme 

Source
pub struct ColorScheme {
Show 19 fields pub foreground: Color, pub background: Color, pub primary: Color, pub secondary: Color, pub error: Color, pub warning: Color, pub success: Color, pub muted: Color, pub accent: Color, pub border: Color, pub user_border: Color, pub user_bg: Color, pub cursor_fg: Color, pub cursor_bg: Color, pub selection_bg: Color, pub tool_pending_bg: Color, pub tool_executing_bg: Color, pub tool_success_bg: Color, pub tool_error_bg: Color,
}
Expand description

Semantic color palette used by components.

Fields§

§foreground: Color

Normal text foreground color.

§background: Color

Default background color.

§primary: Color

Primary accent color (UI elements, labels, user “You”).

§secondary: Color

Secondary color (alternative accents).

§error: Color

Error / danger color.

§warning: Color

Warning / caution color.

§success: Color

Success / confirmation color.

§muted: Color

Muted / dimmed text (e.g. placeholders, tool headers).

§accent: Color

Accent highlight color.

§border: Color

Border / separator color.

§user_border: Color

User message left-border accent (subtle).

§user_bg: Color

User message background (subtle tint).

§cursor_fg: Color

Cursor foreground.

§cursor_bg: Color

Cursor background.

§selection_bg: Color

Selection / highlight background.

§tool_pending_bg: Color

Tool call pending background (waiting state).

§tool_executing_bg: Color

Tool call executing background (running state).

§tool_success_bg: Color

Tool call success background (completed successfully).

§tool_error_bg: Color

Tool call error background (completed with error).

Implementations§

Source§

impl ColorScheme

Source

pub fn dark() -> Self

Default dark color scheme (true black).

Source

pub fn light() -> Self

Default light color scheme.

Source

pub fn to_style(&self) -> Style

Convert to ratatui Style with just foreground.

Source

pub fn to_styles(&self) -> ThemeStyles

Convert to ratatui Style with all semantic colors.

Trait Implementations§

Source§

impl Clone for ColorScheme

Source§

fn clone(&self) -> ColorScheme

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 ColorScheme

Source§

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

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

impl Default for ColorScheme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more