pub enum ColorError {
NonFinite,
AlphaOutOfRange,
ConversionOverflow,
}Expand description
Failure from checked color authoring or transfer conversion.
use ferravex_math::{Color, ColorError};
assert_eq!(Color::try_new(0.0, 0.0, 0.0, 2.0), Err(ColorError::AlphaOutOfRange));Variants§
NonFinite
At least one input RGBA channel is NaN or infinite.
AlphaOutOfRange
Finite alpha is outside the inclusive range 0..=1.
ConversionOverflow
A converted RGB channel would be non-finite when stored as f32.
Trait Implementations§
Source§impl Clone for ColorError
impl Clone for ColorError
Source§fn clone(&self) -> ColorError
fn clone(&self) -> ColorError
Returns a duplicate of the value. Read more
1.0.0 · 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 ColorError
impl Debug for ColorError
Source§impl Display for ColorError
impl Display for ColorError
Source§impl Error for ColorError
impl Error for ColorError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for ColorError
impl PartialEq for ColorError
impl Copy for ColorError
impl Eq for ColorError
impl StructuralPartialEq for ColorError
Auto Trait Implementations§
impl Freeze for ColorError
impl RefUnwindSafe for ColorError
impl Send for ColorError
impl Sync for ColorError
impl Unpin for ColorError
impl UnwindSafe for ColorError
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