pub struct Avatar { /* private fields */ }Implementations§
Source§impl Avatar
impl Avatar
Sourcepub fn new(initials: impl Into<String>) -> Self
pub fn new(initials: impl Into<String>) -> Self
Create an avatar from already-computed initials (rendered verbatim).
Sourcepub fn from_name(name: impl AsRef<str>) -> Self
pub fn from_name(name: impl AsRef<str>) -> Self
Derive initials (up to two letters) and a deterministic background color from a display name.
pub fn size(self, px: f32) -> Self
pub fn small(self) -> Self
pub fn large(self) -> Self
pub fn shape(self, s: AvatarShape) -> Self
pub fn square(self) -> Self
Sourcepub fn background(self, c: Color32) -> Self
pub fn background(self, c: Color32) -> Self
Override the background fill (otherwise theme/seed derived).
Sourcepub fn foreground(self, c: Color32) -> Self
pub fn foreground(self, c: Color32) -> Self
Override the initials color (otherwise contrast-picked).
pub fn status(self, s: AvatarStatus) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Avatar
impl RefUnwindSafe for Avatar
impl Send for Avatar
impl Sync for Avatar
impl Unpin for Avatar
impl UnsafeUnpin for Avatar
impl UnwindSafe for Avatar
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