pub struct Theme {
pub meta: Meta,
pub ansi: Ansi,
pub semantic: Semantic,
pub ui: Ui,
pub base24: Base24Slots,
}Expand description
A complete TCA theme definition.
All color fields contain resolved #rrggbb hex strings.
Fields§
§meta: MetaTheme metadata.
ansi: AnsiANSI 16-color definitions derived from base24 slots.
semantic: SemanticSemantic color roles derived from base24 slots.
ui: UiUI element colors derived from base24 slots.
base24: Base24SlotsRaw base24 color slots for direct interoperability.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn from_base24_slots(slots: Base24Slots) -> Self
pub fn from_base24_slots(slots: Base24Slots) -> Self
Construct a Theme by deriving all fields from a set of base24 slots.
Sourcepub fn from_base24_str(src: &str) -> Result<Self>
pub fn from_base24_str(src: &str) -> Result<Self>
Parse a base24 YAML string and construct a Theme.
Accepts the flat key: "value" YAML subset used by Base16/24 scheme files.
Theme name is read from the scheme key (with name as a fallback).
Sourcepub fn from_raw_slots(slots: &HashMap<String, String>) -> Result<Self>
pub fn from_raw_slots(slots: &HashMap<String, String>) -> Result<Self>
Build a Theme from a parsed [RawSlots] map (e.g. from parse_base24).
Sourcepub fn from_name(name: Option<&str>) -> Theme
pub fn from_name(name: Option<&str>) -> Theme
Creates a Theme from an optional name, searching in order:
- User theme files (if
fsfeature enabled). - Built-in themes.
- User config default (if
fsfeature enabled). - Built-in dark/light default based on terminal mode.
The name is case-insensitive and accepts any common case format
("Nord Dark", "nord-dark", "NordDark" all work).
Sourcepub fn name_slug(&self) -> String
pub fn name_slug(&self) -> String
Returns the kebab-case slug for the theme name.
e.g. "Tokyo Night" -> "tokyo-night"
Sourcepub fn to_filename(&self) -> String
pub fn to_filename(&self) -> String
Returns the canonical file name for the theme.
e.g. "Tokyo Night" -> "tokyo-night.yaml"
Sourcepub fn to_pathbuf(&self) -> Result<PathBuf>
pub fn to_pathbuf(&self) -> Result<PathBuf>
Returns the canonical install path for the theme in the user themes directory.
Sourcepub fn to_base24_str(&self) -> String
pub fn to_base24_str(&self) -> String
Serialize this theme to a base24 YAML string.
The output is a flat key: "value" YAML file compatible with the
Tinted Theming base24 format.
Hex values are written as 6-character lowercase strings without a leading #.
Trait Implementations§
Source§impl Ord for Theme
impl Ord for Theme
Source§impl PartialOrd for Theme
impl PartialOrd for Theme
impl Eq 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.