pub struct ThemeSpec {
pub mode: Mode,
pub accent_hue: Option<f32>,
pub duotone: Option<DuotoneSpec>,
pub derive: Option<DeriveSpec>,
}Expand description
A serializable theme recipe: the few numbers a theme generates from, not hundreds of resolved colors — so files stay tiny, stable across fenestra versions, and hand-editable.
{"mode": "dark", "duotone": {"neutral_hue": 152.0, "chroma": 6.0, "accent_hue": 72.0}}Precedence: derive wins over duotone wins over accent_hue; none
means the stock palette for mode.
Fields§
§mode: ModeLight or dark.
accent_hue: Option<f32>Accent hue in OKLCH degrees (Theme::from_accent).
duotone: Option<DuotoneSpec>Duotone field (Theme::duotone).
derive: Option<DeriveSpec>Three-input derivation (Theme::derive).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ThemeSpec
impl<'de> Deserialize<'de> for ThemeSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThemeSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThemeSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ThemeSpec
impl Serialize for ThemeSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ThemeSpec
Auto Trait Implementations§
impl Freeze for ThemeSpec
impl RefUnwindSafe for ThemeSpec
impl Send for ThemeSpec
impl Sync for ThemeSpec
impl Unpin for ThemeSpec
impl UnsafeUnpin for ThemeSpec
impl UnwindSafe for ThemeSpec
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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.