use thiserror::Error;
#[derive(Debug, Error)]
pub enum ColorError {
#[error("core error: {0}")]
Core(#[from] crate::core::Error),
#[error("unsupported depth: expected {expected}, got {actual}")]
UnsupportedDepth { expected: &'static str, actual: u32 },
#[error("invalid color value: {0}")]
InvalidColorValue(String),
#[error("invalid parameters: {0}")]
InvalidParameters(String),
#[error("quantization error: {0}")]
QuantizationError(String),
#[error("empty image: no pixels to process")]
EmptyImage,
}
pub type ColorResult<T> = Result<T, ColorError>;