use strum_macros::{EnumString, IntoStaticStr};
use thiserror::Error;
use crate::helper::macros::verbose_error_to_error;
#[derive(Debug, Error)]
#[error(transparent)]
pub struct ParseError(#[from] ParseColourError);
#[derive(Debug, Error, EnumString, IntoStaticStr)]
#[non_exhaustive]
pub enum ParseColourError {
#[error("Invalid additive combo count")]
InvalidComboCount,
#[error("Invalid colon separator")]
InvalidColonSeparator,
#[error(transparent)]
#[strum(disabled)]
ParseRgbError(#[from] ParseRgbError),
#[error("Unknown colour type")]
UnknownColourType,
}
verbose_error_to_error!(ParseColourError);
#[derive(Debug, Error, EnumString, IntoStaticStr)]
#[non_exhaustive]
pub enum ParseRgbError {
#[error("Invalid red value")]
InvalidRed,
#[error("Invalid green value")]
InvalidGreen,
#[error("Invalid blue value")]
InvalidBlue,
#[error("Missing green value")]
MissingGreen,
#[error("Missing blue value")]
MissingBlue,
}
verbose_error_to_error!(ParseRgbError);