pub enum ColorError {
Show 15 variants
NoTerminalSupport,
InvalidHexCode(String),
InvalidRGB(String),
UnsupportedColorMode(ColorSupport, ColorSupport),
EnvError(VarError),
InvalidOperation(String),
ColorManipulation(String),
InvalidColorValue(String),
ColorConversionError {
from: &'static str,
to: &'static str,
reason: String,
},
ComponentOutOfRange {
component: &'static str,
value: &'static str,
min: &'static str,
max: &'static str,
},
ValidationError {
component: &'static str,
value: String,
reason: &'static str,
},
TerminalError {
requested: &'static str,
available: Option<&'static str>,
reason: String,
},
ColorSpaceConversion {
from: &'static str,
to: &'static str,
reason: String,
},
ColorCalculation(String),
InterpolationError(String),
}Expand description
Represents errors that can occur when working with colors
Variants§
NoTerminalSupport
Terminal does not support ANSI colors
InvalidHexCode(String)
Invalid hex color code provided
InvalidRGB(String)
Failed to parse RGB values
UnsupportedColorMode(ColorSupport, ColorSupport)
Terminal doesn’t support requested color mode
EnvError(VarError)
Environment variable error
InvalidOperation(String)
Invalid operation attempted
ColorManipulation(String)
Color manipulation error
InvalidColorValue(String)
Invalid color value
ColorConversionError
ComponentOutOfRange
ValidationError
Color component validation error
TerminalError
Terminal capability error
ColorSpaceConversion
Error during color space conversion
ColorCalculation(String)
Mathematical error during color calculations
InterpolationError(String)
Error during color interpolation
Trait Implementations§
Source§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 From<ParseFloatError> for ColorError
impl From<ParseFloatError> for ColorError
Source§fn from(err: ParseFloatError) -> Self
fn from(err: ParseFloatError) -> Self
Converts to this type from the input type.
Source§impl From<VarError> for ColorError
impl From<VarError> for ColorError
Source§impl PartialEq for ColorError
impl PartialEq 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