[][src]Struct stdweb::web::CanvasGradient

pub struct CanvasGradient(_);

The CanvasGradient struct represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient().

(JavaScript docs)

Methods

impl CanvasGradient[src]

pub fn add_color_stop(
    &self,
    offset: f64,
    color: &str
) -> Result<(), AddColorStopError>
[src]

Adds a new stop, defined by an offset and a color, to the gradient. If the offset is not between 0 and 1, an INDEX_SIZE_ERR is returned, if the color can't be parsed as a CSS , a SYNTAX_ERR is returned.

(JavaScript docs)

Trait Implementations

impl JsSerialize for CanvasGradient[src]

impl TryFrom<CanvasGradient> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for CanvasGradient[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for CanvasGradient[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for CanvasGradient[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for CanvasGradient[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for CanvasGradient[src]

impl ReferenceType for CanvasGradient[src]

impl AsRef<Reference> for CanvasGradient[src]

impl From<CanvasGradient> for Reference[src]

impl Clone for CanvasGradient[src]

impl Eq for CanvasGradient[src]

impl PartialEq<CanvasGradient> for CanvasGradient[src]

impl Debug for CanvasGradient[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]