pub struct CanvasGradient {
pub kind: GradientKind,
pub stops: Vec<ColorStop>,
}Expand description
Canvas 2D のグラデーションオブジェクト。
Fields§
§kind: GradientKind§stops: Vec<ColorStop>Implementations§
Source§impl CanvasGradient
impl CanvasGradient
pub fn new_linear(x0: f32, y0: f32, x1: f32, y1: f32) -> Self
pub fn new_radial(x0: f32, y0: f32, r0: f32, x1: f32, y1: f32, r1: f32) -> Self
pub fn add_color_stop(&mut self, offset: f32, color: u32)
Sourcepub fn calculate_t(&self, x: f32, y: f32) -> f32
pub fn calculate_t(&self, x: f32, y: f32) -> f32
座標 (x, y) における射影パラメータ t (0.0..=1.0) を計算する。
Trait Implementations§
Source§impl Clone for CanvasGradient
impl Clone for CanvasGradient
Source§fn clone(&self) -> CanvasGradient
fn clone(&self) -> CanvasGradient
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 CanvasGradient
impl Debug for CanvasGradient
Source§impl PartialEq for CanvasGradient
impl PartialEq for CanvasGradient
Source§fn eq(&self, other: &CanvasGradient) -> bool
fn eq(&self, other: &CanvasGradient) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CanvasGradient
Auto Trait Implementations§
impl Freeze for CanvasGradient
impl RefUnwindSafe for CanvasGradient
impl Send for CanvasGradient
impl Sync for CanvasGradient
impl Unpin for CanvasGradient
impl UnsafeUnpin for CanvasGradient
impl UnwindSafe for CanvasGradient
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