Skip to main content

ThemeColors

Struct ThemeColors 

Source
pub struct ThemeColors {
Show 16 fields pub bg_base: Option<u32>, pub bg_surface: Option<u32>, pub bg_elevated: Option<u32>, pub text_primary: Option<u32>, pub text_secondary: Option<u32>, pub text_muted: Option<u32>, pub accent_primary: Option<u32>, pub accent_hover: Option<u32>, pub accent_muted: Option<u32>, pub border_subtle: Option<u32>, pub border_strong: Option<u32>, pub success: Option<u32>, pub warning: Option<u32>, pub error: Option<u32>, pub info: Option<u32>, pub chart_palette: Vec<u32>,
}
Expand description

Color palette for a custom theme.

All colors are optional - missing colors are inherited from the base theme. Colors are stored as RGB hex values (e.g., 0x1a1b26 for #1a1b26).

Fields§

§bg_base: Option<u32>

Main canvas background (e.g., 0x1a1b26)

§bg_surface: Option<u32>

Surface/panel background

§bg_elevated: Option<u32>

Elevated elements (cards, dropdowns)

§text_primary: Option<u32>

Primary text color

§text_secondary: Option<u32>

Secondary text color

§text_muted: Option<u32>

Muted/disabled text color

§accent_primary: Option<u32>

Primary accent color

§accent_hover: Option<u32>

Hover accent color (brighter)

§accent_muted: Option<u32>

Muted accent color (for subtle backgrounds)

§border_subtle: Option<u32>

Subtle border color

§border_strong: Option<u32>

Strong border color

§success: Option<u32>

Success color (green-ish)

§warning: Option<u32>

Warning color (yellow/orange-ish)

§error: Option<u32>

Error color (red-ish)

§info: Option<u32>

Info color (blue-ish)

§chart_palette: Vec<u32>

Colors for chart series (up to 8)

Implementations§

Source§

impl ThemeColors

Source

pub fn parse_hex(s: &str) -> Option<u32>

Parse a hex color string (e.g., “#1a1b26” or “1a1b26”) to u32.

Source

pub fn to_rgb(color: u32) -> (u8, u8, u8)

Convert u32 RGB to (r, g, b) tuple.

Trait Implementations§

Source§

impl Clone for ThemeColors

Source§

fn clone(&self) -> ThemeColors

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ThemeColors

Source§

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

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

impl Default for ThemeColors

Source§

fn default() -> ThemeColors

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, 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> MaybeSend for T
where T: Send,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,