Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
Show 17 fields pub name: &'static str, pub bg_app: Color, pub bg_panel: Color, pub bg_panel_alt: Color, pub bg_input: Color, pub bg_input_focus: Color, pub bg_button: Color, pub bg_button_hover: Color, pub bg_selected: Color, pub bg_row_hover: Color, pub fg_text: Color, pub fg_muted: Color, pub fg_placeholder: Color, pub fg_destructive: Color, pub border: Color, pub border_focus: Color, pub accent: Color,
}
Expand description

Paleta de la app. Slots semánticos que cubren los casos comunes (fondo, texto, hover, foco, acento). Los widgets reusables toman su Palette específico desde acá vía Palette::from_theme(&theme).

Fields§

§name: &'static str

Nombre legible del preset — alimenta Theme::by_name, next_after, y los UIs que ciclan presets (theme-switcher).

§bg_app: Color

Fondo de la ventana / superficie raíz.

§bg_panel: Color

Fondo de paneles (sidebars, cards).

§bg_panel_alt: Color

Fondo alternativo para barras / strips (tab bar, status bar).

§bg_input: Color

Fondo de campos de input (texto editable).

§bg_input_focus: Color

Fondo de input cuando tiene foco.

§bg_button: Color

Fondo de botón (chip).

§bg_button_hover: Color

Fondo de botón al hover.

§bg_selected: Color

Fondo de la fila/item seleccionado (lista, tree).

§bg_row_hover: Color

Fondo de fila al hover (sin selección).

§fg_text: Color§fg_muted: Color§fg_placeholder: Color§fg_destructive: Color§border: Color§border_focus: Color§accent: Color

Acento primario — divisores activos, borde de input focado, underline del tab activo, etc. Tono único de la app.

Implementations§

Source§

impl Theme

Source

pub const fn dark() -> Self

Tema oscuro — el default. Análogo al nahual-theme dark en su versión Llimphi: tonos azulados profundos, acento azul claro.

Source

pub const fn tawa() -> Self

Tema “Tawa” — el LOOK FIRMA de la suite, el que se publica en screenshots. Decisiones de paleta:

  • Base negro cálido, no azul marino. A diferencia de dark() (un navy genérico, R<B) acá el fondo es un casi-negro con temperatura: los canales rojo/verde van un punto por encima del azul, así el grafito “respira” tibio en vez de frío. Jerarquía de superficies en escalera suave: bg_app (más profundo) → bg_panel/bg_input → barras → chips, sin saltos bruscos.
  • Acento teal-eléctrico (#2BD9A6), NO azul. El mar de unixporn es todo azul (Catppuccin/Tokyo Night); elegimos un verde-aguamarina vibrante para destacar de inmediato — distintivo pero no chillón, con raíz en el teal del CDE / del logo de la suite. accent y border_focus comparten ese tono; la selección lo usa atenuado para no encandilar filas enteras.
  • Texto legible (WCAG AA). fg_text (#E8E6E0, marfil cálido) supera 12:1 sobre bg_app y ~10:1 sobre bg_panel; fg_muted ronda 5:1 (texto secundario cómodo); fg_placeholder queda como hint tenue.
  • Armonía: todos los grises llevan el mismo tinte cálido y el acento es el único color saturado — la paleta se lee como una sola pieza.
Source

pub const fn light() -> Self

Tema claro — contraste revisado para WCAG AA sobre bg_app: fg_text ~12:1, fg_muted ~5.4:1 (texto secundario legible), fg_destructive y accent oscurecidos para superar 4.5:1 sobre fondos claros. fg_placeholder queda deliberadamente tenue (hint, no contenido).

Source

pub const fn aurora() -> Self

Tema “Aurora” — verdes nocturnos con acento aqua. Análogo al preset del nahual-theme.

Source

pub const fn sunset() -> Self

Tema “Sunset” — cálidos con acento naranja, sobre base oscura.

Source

pub const fn print() -> Self

Tema “Print” — blanco y negro de alto contraste para impresión. Fondo blanco papel, tinta negra, sin grises decorativos: todo lo que se imprime tiene que leerse en una fotocopiadora. fg_muted es un gris medio (3.5:1) reservado a metadatos; el cuerpo va en negro puro. Acento y bordes negros — la tinta es una sola.

Source

pub const fn xp_blue() -> Self

Skin Windows XP “Luna” — escritorio azul-gris claro, selección y acento en el azul XP (#316AC5), chrome celeste. Para la vista windows-xp.

Source

pub const fn mac_light() -> Self

Skin macOS (Big Sur claro) — casi blanco, grises sutiles, acento azul de sistema (#0A84FF). Para la vista mac.

Source

pub const fn kde_breeze() -> Self

Skin KDE Plasma “Breeze” (claro) — gris papel (#eff0f1), acento azul Breeze (#3daee9). Para la vista kde.

Source

pub const fn win31() -> Self

Skin Windows 3.1: gris Motif (#c0c0c0) con barra de título azul marino (#000080) y escritorio teal. La era de los biseles. Para la vista windows-3.1.

Source

pub const fn cde() -> Self

Skin Solaris CDE (era dorada): gris-beige Motif con acento teal — el Common Desktop Environment. Para la vista solaris.

Source

pub fn sunken(&self) -> Color

Superficie “hundida” — un escalón más profunda que bg_app, para áreas de lectura intensa (output de terminal, viewports de log, IDE-text) que deben recibir el texto con más contraste que el chrome y leerse recesadas respecto del marco. En temas oscuros oscurece bg_app hacia el negro; en claros lo aleja un paso del blanco. Las cards/strips (bg_panel, bg_panel_alt) quedan flotando por encima. Derivada de la paleta — no inventa un color suelto.

Source

pub fn all() -> Vec<Self>

Todos los presets del repo, en el orden canónico de rotación (Tawa → Dark → Light → Aurora → Sunset → Tawa…). tawa() va al frente: es el look firma de la suite, el primero que se ve. El theme-switcher los consume vía Theme::next_after. print() queda fuera de la rotación a propósito — es un modo deliberado (imprimir), no un gusto estético que se cicle por accidente.

Source

pub fn by_name(name: &str) -> Option<Self>

Busca un preset por nombre exacto. Incluye los modos deliberados que quedan fuera de la rotación casual (print y los skins de vista WinXP/macOS/Breeze), para que Config::theme los resuelva.

Source

pub fn next_after(current: &str) -> Self

Próximo preset en la rotación de Theme::all. Si current no se encuentra, retorna el primero — el switcher nunca se traba.

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

Source§

fn default() -> Self

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

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

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

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