pub struct Icon {
pub name: &'static str,
pub kind: Kind,
pub title: &'static str,
pub svg: &'static str,
pub svg_dark: &'static str,
}Expand description
One icon: its name, kind, title and SVG source for light and dark backgrounds.
Fields§
§name: &'static strKebab-case file stem, such as "linear-pattern".
kind: Kind§title: &'static strHuman-readable name, such as "Linear pattern".
svg: &'static strFor light backgrounds: dark outline, white to mid-grey faces.
svg_dark: &'static strFor dark backgrounds: light outline, darker faces, same lighting direction.
Implementations§
Source§impl Icon
impl Icon
Sourcepub fn recolor(&self, palette: &Palette) -> String
pub fn recolor(&self, palette: &Palette) -> String
The light SVG with every palette colour replaced by the matching slot in palette.
Sourcepub fn tinted(&self, color: impl Into<Rgb>) -> String
pub fn tinted(&self, color: impl Into<Rgb>) -> String
The light SVG with its ink painted color; any accent detail keeps the light accent.
Meant for Kind::is_tintable icons; for other kinds only the outlines change.
Sourcepub fn tinted_with(
&self,
color: impl Into<Rgb>,
accent: impl Into<Rgb>,
) -> String
pub fn tinted_with( &self, color: impl Into<Rgb>, accent: impl Into<Rgb>, ) -> String
The light SVG with its ink painted color and its accent detail painted accent.
Sourcepub fn has_accent(&self) -> bool
pub fn has_accent(&self) -> bool
Whether the icon has any accent-coloured detail. Apps that tint by multiplying a single-colour raster need a second layer (or a pre-coloured raster) for these.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Icon
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnsafeUnpin for Icon
impl UnwindSafe for Icon
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more