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_MAGENTA: 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more