Struct color_conv::cmyk::Cmyk[][src]

pub struct Cmyk {
    pub cyan: u8,
    pub magenta: u8,
    pub yellow: u8,
    pub key: u8,
}

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 color
  • magenta - the magenta value of the color
  • yellow - the yellow value of the color
  • key - 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]

See Cmyk::new. Does not perform check to ensure that all parameters are less than or equal to 100. This is useful for when you know more than the compiler about which values are being passed to the method.

Examples

use color_conv::Cmyk;
let cyan = Cmyk::new_unchecked(100, 0, 0, 0);

Trait Implementations

impl Clone for Cmyk[src]

impl Color for Cmyk[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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.