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§
source§impl 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.