Struct pdfium_render::color::PdfColor
source · [−]pub struct PdfColor { /* private fields */ }Expand description
A 32-bit RGB color value with an optional alpha channel.
Certain basic primary colors are available as const values on this struct.
Note that when used as a form field highlight color, a solid color with no opacity will overprint any user data in the field. Use the PdfColor::with_alpha() function to apply an alpha channel value to an existing PdfColor.
Implementations
sourceimpl PdfColor
impl PdfColor
pub const SOLID_WHITE: PdfColor
pub const SOLID_RED: PdfColor
pub const SOLID_GREEN: PdfColor
pub const SOLID_BLUE: PdfColor
pub const SOLID_CYAN: PdfColor
pub const SOLID_YELLOW: PdfColor
sourcepub const fn new(red: u8, green: u8, blue: u8, alpha: u8) -> Self
pub const fn new(red: u8, green: u8, blue: u8, alpha: u8) -> Self
Constructs a new PdfColor object from the given arguments.
sourcepub const fn with_alpha(&self, alpha: u8) -> Self
pub const fn with_alpha(&self, alpha: u8) -> Self
Constructs a new PdfColor by copying the red, green, and blue color components of this color and applying the given alpha value.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PdfColor
impl Send for PdfColor
impl Sync for PdfColor
impl Unpin for PdfColor
impl UnwindSafe for PdfColor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more