pub struct ColorTween { /* private fields */ }Expand description
Perceptual color tween.
Implementations§
Source§impl ColorTween
impl ColorTween
Sourcepub fn new(
from: &str,
to: &str,
duration: f32,
space: &str,
) -> Result<Self, JsValue>
pub fn new( from: &str, to: &str, duration: f32, space: &str, ) -> Result<Self, JsValue>
Create a color tween from hex colors.
Sourcepub fn rgba_array(&self) -> Float32Array
pub fn rgba_array(&self) -> Float32Array
Current color as [r, g, b, a] in 0-1 floats.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether playback is complete.
Trait Implementations§
Source§impl Clone for ColorTween
impl Clone for ColorTween
Source§fn clone(&self) -> ColorTween
fn clone(&self) -> ColorTween
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 ColorTween
impl Debug for ColorTween
Source§impl From<ColorTween> for JsValue
impl From<ColorTween> for JsValue
Source§fn from(value: ColorTween) -> Self
fn from(value: ColorTween) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for ColorTween
impl FromWasmAbi for ColorTween
Source§impl IntoWasmAbi for ColorTween
impl IntoWasmAbi for ColorTween
Source§impl LongRefFromWasmAbi for ColorTween
impl LongRefFromWasmAbi for ColorTween
Source§type Abi = WasmPtr<WasmRefCell<ColorTween>>
type Abi = WasmPtr<WasmRefCell<ColorTween>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<ColorTween>
type Anchor = RcRef<ColorTween>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for ColorTween
impl OptionFromWasmAbi for ColorTween
Source§impl OptionIntoWasmAbi for ColorTween
impl OptionIntoWasmAbi for ColorTween
Source§impl RefFromWasmAbi for ColorTween
impl RefFromWasmAbi for ColorTween
Source§type Abi = WasmPtr<WasmRefCell<ColorTween>>
type Abi = WasmPtr<WasmRefCell<ColorTween>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<ColorTween>
type Anchor = RcRef<ColorTween>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for ColorTween
impl RefMutFromWasmAbi for ColorTween
Source§type Abi = WasmPtr<WasmRefCell<ColorTween>>
type Abi = WasmPtr<WasmRefCell<ColorTween>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<ColorTween>
type Anchor = RcRefMut<ColorTween>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl TryFromJsValue for ColorTween
impl TryFromJsValue for ColorTween
Source§impl VectorFromWasmAbi for ColorTween
impl VectorFromWasmAbi for ColorTween
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[ColorTween]>
Source§impl VectorIntoWasmAbi for ColorTween
impl VectorIntoWasmAbi for ColorTween
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[ColorTween]>) -> Self::Abi
Source§impl WasmDescribeVector for ColorTween
impl WasmDescribeVector for ColorTween
impl SupportsConstructor for ColorTween
impl SupportsInstanceProperty for ColorTween
impl SupportsStaticProperty for ColorTween
Auto Trait Implementations§
impl Freeze for ColorTween
impl RefUnwindSafe for ColorTween
impl Send for ColorTween
impl Sync for ColorTween
impl Unpin for ColorTween
impl UnsafeUnpin for ColorTween
impl UnwindSafe for ColorTween
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.