Trait colstodian::traits::DynColor [−][src]
pub trait DynColor { fn downcast<Spc: ColorSpace, St: State>(
&self
) -> ColorResult<Color<Spc, St>>; fn downcast_unchecked<Spc: ColorSpace, St: State>(&self) -> Color<Spc, St>; }
Expand description
Required methods
fn downcast<Spc: ColorSpace, St: State>(&self) -> ColorResult<Color<Spc, St>>
fn downcast<Spc: ColorSpace, St: State>(&self) -> ColorResult<Color<Spc, St>>
Attempt to convert to a typed Color
. Returns an error if self
’s color space and state do not match
the given types.
fn downcast_unchecked<Spc: ColorSpace, St: State>(&self) -> Color<Spc, St>
fn downcast_unchecked<Spc: ColorSpace, St: State>(&self) -> Color<Spc, St>
Convert to a typed Color
without checking if the color space and state types
match this color’s space and state. Use only if you are sure that this color
is in the correct format.