Struct valence_text::color::RgbColor
source · pub struct RgbColor {
pub r: u8,
pub g: u8,
pub b: u8,
}
Expand description
RGB Color
Fields§
§r: u8
Red channel
g: u8
Green channel
b: u8
Blue channel
Implementations§
source§impl RgbColor
impl RgbColor
sourcepub const fn new(r: u8, g: u8, b: u8) -> Self
pub const fn new(r: u8, g: u8, b: u8) -> Self
Constructs a new color from red, green, and blue components.
sourcepub fn to_named_lossy(self) -> NamedColor
pub fn to_named_lossy(self) -> NamedColor
Converts the RGB color to the closest NamedColor
equivalent (lossy).
Trait Implementations§
source§impl From<NamedColor> for RgbColor
impl From<NamedColor> for RgbColor
source§fn from(value: NamedColor) -> Self
fn from(value: NamedColor) -> Self
Converts to this type from the input type.
source§impl Ord for RgbColor
impl Ord for RgbColor
source§impl PartialOrd for RgbColor
impl PartialOrd for RgbColor
impl Copy for RgbColor
impl Eq for RgbColor
impl StructuralPartialEq for RgbColor
Auto Trait Implementations§
impl Freeze for RgbColor
impl RefUnwindSafe for RgbColor
impl Send for RgbColor
impl Sync for RgbColor
impl Unpin for RgbColor
impl UnwindSafe for RgbColor
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.