Struct color_conv::cmyk::Cmyk [−][src]
A representation of the CMYK (cyan, magenta, yellow, key) color format.
Fields
cyan: u8
Cyan value (percentage)
magenta: u8
Magenta value (percentage)
yellow: u8
Yellow value (percentage)
key: u8
Key value (percentage)
Implementations
impl Cmyk
[src]
pub fn new(cyan: u8, magenta: u8, yellow: u8, key: u8) -> Result<Self, Error>
[src]
Returns a Result containing a new Cmyk object given cyan, magenta,
yellow, and key values. Will return an Error
if any of the arguments
are larger than 100 due to the fact that they represent percentages.
Arguments
cyan
- the cyan value of the colormagenta
- the magenta value of the coloryellow
- the yellow value of the colorkey
- the key value of the color
Examples
use color_conv::Cmyk; let cyan = Cmyk::new(100, 0, 0, 0)?;
pub fn new_unchecked(cyan: u8, magenta: u8, yellow: u8, key: u8) -> Self
[src]
Trait Implementations
impl Clone for Cmyk
[src]
impl Color for Cmyk
[src]
fn to_rgb(self) -> Rgb
[src]
fn to_cmyk(self) -> Cmyk
[src]
fn to_hex_string(self) -> String
[src]
fn to_hsl(self) -> Hsl
[src]
impl Copy for Cmyk
[src]
impl Debug for Cmyk
[src]
impl Display for Cmyk
[src]
impl Eq for Cmyk
[src]
impl Hash for Cmyk
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Cmyk> for Cmyk
[src]
impl StructuralEq for Cmyk
[src]
impl StructuralPartialEq for Cmyk
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cmyk
impl Send for Cmyk
impl Sync for Cmyk
impl Unpin for Cmyk
impl UnwindSafe for Cmyk
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,