///
#[allow(warnings)]
pub mod color {
    // Function to convert hex color to RGB
    pub fn hex_to_rgb(hex: &str) -> Result<(u8, u8, u8), String> {
        if hex.len() != 7 || !hex.starts_with('#') {
            return Err("Invalid hex color format".to_string());
        }

        let r = u8::from_str_radix(&hex[1..3], 16).map_err(|e| e.to_string())?;
        let g = u8::from_str_radix(&hex[3..5], 16).map_err(|e| e.to_string())?;
        let b = u8::from_str_radix(&hex[5..7], 16).map_err(|e| e.to_string())?;

        Ok((r, g, b))
    }

    // Function to convert RGB to hex color
    pub fn rgb_to_hex(rgb: (u8, u8, u8)) -> String {
        format!("#{:02X}{:02X}{:02X}", rgb.0, rgb.1, rgb.2)
    }
}
