Skip to main content

UiTheme

Struct UiTheme 

Source
pub struct UiTheme {
Show 34 fields pub background: [f32; 4], pub surface: [f32; 4], pub surface_elevated: [f32; 4], pub surface_interactive: [f32; 4], pub surface_active: [f32; 4], pub separator: [f32; 4], pub border: [f32; 4], pub border_strong: [f32; 4], pub text: [f32; 4], pub text_dim: [f32; 4], pub text_muted: [f32; 4], pub text_disabled: [f32; 4], pub text_inverse: [f32; 4], pub primary: [f32; 4], pub primary_dim: [f32; 4], pub accent_a: [f32; 4], pub accent_b: [f32; 4], pub accent_c: [f32; 4], pub success: [f32; 4], pub warning: [f32; 4], pub error: [f32; 4], pub axis_x: [f32; 4], pub axis_y: [f32; 4], pub axis_z: [f32; 4], pub radius_sm: f32, pub radius_md: f32, pub radius_lg: f32, pub radius_xl: f32, pub font_size_caption: f32, pub font_size_body: f32, pub font_size_title: f32, pub font_size_display: f32, pub pad_row: f32, pub pad_card: f32,
}
Expand description

Color palette and sizing tokens for any Khora UI surface.

Fields§

§background: [f32; 4]

Outermost background (empty regions, behind everything).

§surface: [f32; 4]

Default panel surface.

§surface_elevated: [f32; 4]

Slightly elevated surface (e.g. tab bar, card body).

§surface_interactive: [f32; 4]

Interactive surface (buttons, combo boxes).

§surface_active: [f32; 4]

Hovered or active surface highlight.

§separator: [f32; 4]

Subtle separator (between items inside a panel).

§border: [f32; 4]

Default panel border.

§border_strong: [f32; 4]

Stronger border (used for emphasis around modals, popups).

§text: [f32; 4]

Primary text color.

§text_dim: [f32; 4]

Secondary text (labels, sub-titles).

§text_muted: [f32; 4]

Tertiary text (hints, captions).

§text_disabled: [f32; 4]

Disabled text.

§text_inverse: [f32; 4]

Dark “inverse” ink for text sitting on a filled brand (primary) surface — e.g. the label of a solid silver primary button.

§primary: [f32; 4]

Primary brand color (selection rings, focus highlights).

§primary_dim: [f32; 4]

Dimmed primary (backgrounds of selected rows, etc.).

§accent_a: [f32; 4]

Accent A — secondary brand color.

§accent_b: [f32; 4]

Accent B — tertiary brand color.

§accent_c: [f32; 4]

Accent C — quaternary brand color (warnings of-emphasis, special states).

§success: [f32; 4]

Success indicator (green-family).

§warning: [f32; 4]

Warning indicator (amber-family).

§error: [f32; 4]

Error indicator (red-family).

§axis_x: [f32; 4]

Color for the X axis (typically red-orange).

§axis_y: [f32; 4]

Color for the Y axis (typically green).

§axis_z: [f32; 4]

Color for the Z axis (typically blue).

§radius_sm: f32

Small corner radius (chips, badges).

§radius_md: f32

Medium corner radius (default for buttons / inputs).

§radius_lg: f32

Large corner radius (panels, cards).

§radius_xl: f32

Extra-large corner radius (modal dialogs, palettes).

§font_size_caption: f32

Caption / metadata font size in logical points.

§font_size_body: f32

Body / default font size.

§font_size_title: f32

Section title font size.

§font_size_display: f32

Display heading font size.

§pad_row: f32

Default vertical padding for a row of content.

§pad_card: f32

Default inner padding for a card.

Trait Implementations§

Source§

impl Clone for UiTheme

Source§

fn clone(&self) -> UiTheme

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 UiTheme

Source§

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

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

impl Default for UiTheme

Default theme: a neutral dark palette suitable for any app.

Apps that want a branded look (e.g. the Khora “Deep Navy / Silver” palette) build their own UiTheme and pass it where needed.

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> AppLifecycle for T
where T: ?Sized,

Source§

fn on_start(&mut self, ctx: &mut dyn AppContext)

Called once after the backend is up but before the first update. Apps install their theme / fonts here.
Source§

fn on_exit(&mut self)

Called once when the window is closing. Persist state here.
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the inner value as &dyn Any.
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> 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.