pub enum Color {
Rgb(f64, f64, f64),
Gray(f64),
Cmyk(f64, f64, f64, f64),
}Expand description
Represents a color in PDF documents.
Supports RGB, Grayscale, and CMYK color spaces.
Variants§
Rgb(f64, f64, f64)
RGB color (red, green, blue) with values from 0.0 to 1.0
Gray(f64)
Grayscale color with value from 0.0 (black) to 1.0 (white)
Cmyk(f64, f64, f64, f64)
CMYK color (cyan, magenta, yellow, key/black) with values from 0.0 to 1.0
Implementations§
Source§impl Color
impl Color
Sourcepub fn rgb(r: f64, g: f64, b: f64) -> Self
pub fn rgb(r: f64, g: f64, b: f64) -> Self
Creates an RGB color with values clamped to 0.0-1.0.
Sourcepub fn cmyk(c: f64, m: f64, y: f64, k: f64) -> Self
pub fn cmyk(c: f64, m: f64, y: f64, k: f64) -> Self
Creates a CMYK color with values clamped to 0.0-1.0.
pub fn yellow() -> Self
pub fn cyan() -> Self
pub fn magenta() -> Self
Sourcepub fn to_pdf_array(&self) -> Object
pub fn to_pdf_array(&self) -> Object
Convert to PDF array representation
Trait Implementations§
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
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