Merge pull request #2329 from casperstorm/feat/ferra
feat: added Ferra theme
This commit is contained in:
commit
9d79d7b96b
2 changed files with 21 additions and 0 deletions
|
|
@ -52,6 +52,8 @@ pub enum Theme {
|
||||||
Nightfly,
|
Nightfly,
|
||||||
/// The built-in Oxocarbon variant.
|
/// The built-in Oxocarbon variant.
|
||||||
Oxocarbon,
|
Oxocarbon,
|
||||||
|
/// The built-in Ferra variant:
|
||||||
|
Ferra,
|
||||||
/// A [`Theme`] that uses a [`Custom`] palette.
|
/// A [`Theme`] that uses a [`Custom`] palette.
|
||||||
Custom(Arc<Custom>),
|
Custom(Arc<Custom>),
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +82,7 @@ impl Theme {
|
||||||
Self::Moonfly,
|
Self::Moonfly,
|
||||||
Self::Nightfly,
|
Self::Nightfly,
|
||||||
Self::Oxocarbon,
|
Self::Oxocarbon,
|
||||||
|
Self::Ferra,
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Creates a new custom [`Theme`] from the given [`Palette`].
|
/// Creates a new custom [`Theme`] from the given [`Palette`].
|
||||||
|
|
@ -121,6 +124,7 @@ impl Theme {
|
||||||
Self::Moonfly => Palette::MOONFLY,
|
Self::Moonfly => Palette::MOONFLY,
|
||||||
Self::Nightfly => Palette::NIGHTFLY,
|
Self::Nightfly => Palette::NIGHTFLY,
|
||||||
Self::Oxocarbon => Palette::OXOCARBON,
|
Self::Oxocarbon => Palette::OXOCARBON,
|
||||||
|
Self::Ferra => Palette::FERRA,
|
||||||
Self::Custom(custom) => custom.palette,
|
Self::Custom(custom) => custom.palette,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -151,6 +155,7 @@ impl Theme {
|
||||||
Self::Moonfly => &palette::EXTENDED_MOONFLY,
|
Self::Moonfly => &palette::EXTENDED_MOONFLY,
|
||||||
Self::Nightfly => &palette::EXTENDED_NIGHTFLY,
|
Self::Nightfly => &palette::EXTENDED_NIGHTFLY,
|
||||||
Self::Oxocarbon => &palette::EXTENDED_OXOCARBON,
|
Self::Oxocarbon => &palette::EXTENDED_OXOCARBON,
|
||||||
|
Self::Ferra => &palette::EXTENDED_FERRA,
|
||||||
Self::Custom(custom) => &custom.extended,
|
Self::Custom(custom) => &custom.extended,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,6 +185,7 @@ impl fmt::Display for Theme {
|
||||||
Self::Moonfly => write!(f, "Moonfly"),
|
Self::Moonfly => write!(f, "Moonfly"),
|
||||||
Self::Nightfly => write!(f, "Nightfly"),
|
Self::Nightfly => write!(f, "Nightfly"),
|
||||||
Self::Oxocarbon => write!(f, "Oxocarbon"),
|
Self::Oxocarbon => write!(f, "Oxocarbon"),
|
||||||
|
Self::Ferra => write!(f, "Ferra"),
|
||||||
Self::Custom(custom) => custom.fmt(f),
|
Self::Custom(custom) => custom.fmt(f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,17 @@ impl Palette {
|
||||||
success: color!(0x00c15a),
|
success: color!(0x00c15a),
|
||||||
danger: color!(0xf62d0f),
|
danger: color!(0xf62d0f),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// The built-in [Ferra] variant of a [`Palette`].
|
||||||
|
///
|
||||||
|
/// [Ferra]: https://github.com/casperstorm/ferra
|
||||||
|
pub const FERRA: Self = Self {
|
||||||
|
background: color!(0x2b292d),
|
||||||
|
text: color!(0xfecdb2),
|
||||||
|
primary: color!(0xd1d1e0),
|
||||||
|
success: color!(0xb1b695),
|
||||||
|
danger: color!(0xe06b75),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An extended set of colors generated from a [`Palette`].
|
/// An extended set of colors generated from a [`Palette`].
|
||||||
|
|
@ -379,6 +390,10 @@ pub static EXTENDED_NIGHTFLY: Lazy<Extended> =
|
||||||
pub static EXTENDED_OXOCARBON: Lazy<Extended> =
|
pub static EXTENDED_OXOCARBON: Lazy<Extended> =
|
||||||
Lazy::new(|| Extended::generate(Palette::OXOCARBON));
|
Lazy::new(|| Extended::generate(Palette::OXOCARBON));
|
||||||
|
|
||||||
|
/// The built-in Ferra variant of an [`Extended`] palette.
|
||||||
|
pub static EXTENDED_FERRA: Lazy<Extended> =
|
||||||
|
Lazy::new(|| Extended::generate(Palette::FERRA));
|
||||||
|
|
||||||
impl Extended {
|
impl Extended {
|
||||||
/// Generates an [`Extended`] palette from a simple [`Palette`].
|
/// Generates an [`Extended`] palette from a simple [`Palette`].
|
||||||
pub fn generate(palette: Palette) -> Self {
|
pub fn generate(palette: Palette) -> Self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue