pub struct AppearanceColor {
pub r: f64,
pub g: f64,
pub b: f64,
}Expand description
RGB color used inside annotation appearance streams.
Components are PDF DeviceRGB values in the 0.0–1.0 range. Out-of-range
values are written verbatim and clamped by the consuming PDF viewer.
Used by AppearanceStreamBuilder to emit rg (fill) and RG
(stroke) operators in the generated content stream.
Fields§
§r: f64Red component, 0.0–1.0.
g: f64Green component, 0.0–1.0.
b: f64Blue component, 0.0–1.0.
Implementations§
Source§impl AppearanceColor
impl AppearanceColor
Sourcepub fn new(r: f64, g: f64, b: f64) -> Self
pub fn new(r: f64, g: f64, b: f64) -> Self
Construct a new RGB color from components in the 0.0–1.0 range. No clamping is performed at construction time; values are passed through to the emitted PDF content stream as-is.
Sourcepub fn stroke_ops(&self) -> Operation
pub fn stroke_ops(&self) -> Operation
Push stroke color operators (RG).
Trait Implementations§
Source§impl Clone for AppearanceColor
impl Clone for AppearanceColor
Source§fn clone(&self) -> AppearanceColor
fn clone(&self) -> AppearanceColor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AppearanceColor
impl Debug for AppearanceColor
impl Copy for AppearanceColor
Auto Trait Implementations§
impl Freeze for AppearanceColor
impl RefUnwindSafe for AppearanceColor
impl Send for AppearanceColor
impl Sync for AppearanceColor
impl Unpin for AppearanceColor
impl UnsafeUnpin for AppearanceColor
impl UnwindSafe for AppearanceColor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more