pub struct Rgb {
pub red: u8,
pub green: u8,
pub blue: u8,
}
Expand description
Consistent color in RGB format, produced from a hashed string.
Fields§
§red: u8
Red component
green: u8
Green component
blue: u8
Blue component
Implementations§
Source§impl Rgb
impl Rgb
Sourcepub fn from_resource(nick: &ResourceRef) -> Self
pub fn from_resource(nick: &ResourceRef) -> Self
Hash a ResourceRef
, usually a pseudonymous MUC nickname, to a RGB color.
Sourcepub fn from_barejid(jid: &BareJid) -> Self
pub fn from_barejid(jid: &BareJid) -> Self
Hash a BareJid
to a RGB color, usually a roster contact or a non-anonymous MUC member.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rgb
impl RefUnwindSafe for Rgb
impl Send for Rgb
impl Sync for Rgb
impl Unpin for Rgb
impl UnwindSafe for Rgb
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