Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
Show 33 fields pub background: Rgb, pub surface: Rgb, pub overlay_bg: Rgb, pub title_bg: Rgb, pub status_bg: Rgb, pub gauge_bg: Rgb, pub text: Rgb, pub muted: Rgb, pub dim: Rgb, pub border: Rgb, pub accent: Rgb, pub accent_soft: Rgb, pub title_accent: Rgb, pub pink: Rgb, pub success: Rgb, pub warning: Rgb, pub error: Rgb, pub info: Rgb, pub gauge_fg: Rgb, pub directory: Rgb, pub executable: Rgb, pub symlink: Rgb, pub device: Rgb, pub device_warn: Rgb, pub hidden: Rgb, pub selection_bg: Rgb, pub selection_fg: Rgb, pub cursor_bg: Rgb, pub cursor_fg: Rgb, pub marked_bg: Rgb, pub marked_fg: Rgb, pub buttonbar_bg: Rgb, pub buttonbar_fg: Rgb,
}
Expand description

A complete color theme. All slots are truecolor Rgb(u8, u8, u8).

33 slots, organised into seven semantic groups:

  • Surface/background family (6): background, surface, overlay_bg, title_bg, status_bg, gauge_bg. The three-tier surface (background < surface < overlay_bg) gives cards visual lift without resorting to greyscale.
  • Foreground/text family (4): text, muted, dim, border. dim deliberately fails WCAG AA-body — it is for de-emphasis only.
  • Accent family (4): accent, accent_soft, title_accent, pink. accent is the brand red and is identical in both dark and light themes; title_accent is a brighter red for title bars.
  • Semantic family (4): success, warning, error, info. Apps must add a non-colour cue (glyph, bold, underline) alongside these — see local/docs/RED-BEAR-TUI-THEME.md.
  • Gauge (1): gauge_fg (brand-red progress fill; matches accent so a dark-accent progress bar uses the same hex as the selected-row highlight).
  • File-type slots (tlc) (6): directory, executable, symlink, device, device_warn, hidden.
  • Selection/cursor/marked (tlc) (8): selection_{bg,fg}, cursor_{bg,fg}, marked_{bg,fg}, buttonbar_{bg,fg}.

Fields§

§background: Rgb

Default panel body background.

§surface: Rgb

Raised card (slightly lighter than background).

§overlay_bg: Rgb

Modal/popup background (between body and card).

§title_bg: Rgb

Title bar / section header background.

§status_bg: Rgb

Status line / button bar background.

§gauge_bg: Rgb

Progress bar unfilled portion.

§text: Rgb

Primary body text.

§muted: Rgb

Secondary text, labels, hints.

§dim: Rgb

De-emphasized text, disabled items. AA-large only.

§border: Rgb

Panel borders, separators. AA-body compliant.

§accent: Rgb

Primary brand red — selection, focused borders, brand marks.

§accent_soft: Rgb

Washed red — hover, secondary accents.

§title_accent: Rgb

Brighter red for title bar foreground.

§pink: Rgb

Highlight / favorite / active link. Used sparingly.

§success: Rgb

Completed operations, online state.

§warning: Rgb

Caution, pending state.

§error: Rgb

Failure, destructive action.

§info: Rgb

Informational badges.

§gauge_fg: Rgb

Brand-red progress fill. Identical in dark and light themes (matches accent so a progress bar uses the same hex as the selected-row highlight). Apps that need a non-brand gauge fill can replace this slot per-theme (e.g. a separate cub_progress theme struct).

§directory: Rgb

Folder names.

§executable: Rgb

Executable (+x) files.

§symlink: Rgb

Symbolic links.

§device: Rgb

Device nodes (/dev/*).

§device_warn: Rgb

Unmounted / error-state device.

§hidden: Rgb

Dotfiles (alias of dim).

§selection_bg: Rgb

Inactive selection background.

§selection_fg: Rgb

Inactive selection foreground.

§cursor_bg: Rgb

Active cursor line background.

§cursor_fg: Rgb

Active cursor line foreground.

§marked_bg: Rgb

F3-marked files background.

§marked_fg: Rgb

F3-marked files foreground.

§buttonbar_bg: Rgb

F-key button bar background.

§buttonbar_fg: Rgb

F-key button bar foreground.

Implementations§

Source§

impl Theme

Source

pub const fn dark() -> Self

The default dark theme. Used when no theme preference is set.

Source

pub const fn light() -> Self

The light theme. Opt in with REDBEAR_TUI_THEME=light or by calling this directly. Brand red is identical to dark.

Source

pub fn from_env() -> Self

Pick a theme from environment. Checks REDBEAR_TUI_THEME first (values: dark, light), then falls back to the standard COLORFGBG terminal convention (light bg → light theme). Returns dark if neither is set.

Trait Implementations§

Source§

impl Clone for Theme

Source§

fn clone(&self) -> Theme

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 Copy for Theme

Source§

impl Debug for Theme

Source§

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

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

impl Eq for Theme

Source§

impl PartialEq for Theme

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Theme

Auto Trait Implementations§

§

impl Freeze for Theme

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnsafeUnpin for Theme

§

impl UnwindSafe for Theme

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