[−][src]Struct Color::RGB
Create RGB instance.
Implementations
impl RGB
[src]
pub fn value(&self) -> [u8; 3]
[src]
Get RGB value.
pub fn inverted(&mut self) -> &mut Self
[src]
Inverted rgb value.
pub fn to_hex(&self) -> String
[src]
convart rgb value to hex value.
pub fn contrast_ratio(&self, rgb: [u8; 3]) -> f64
[src]
Get contrast ratio between two colors.
pub fn from_hex(hex_value: &str) -> Result<Self, &str>
[src]
Auto Trait Implementations
impl RefUnwindSafe for RGB
[src]
impl Send for RGB
[src]
impl Sync for RGB
[src]
impl Unpin for RGB
[src]
impl UnwindSafe for RGB
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,