pub fn convert_hex_colour_to_rgb(
    hexcolour: String,
) -> Result<(f64, f64, f64), std::num::ParseIntError> {
    let increment;
    let r: f64;
    let g: f64;
    let b: f64;

    if hexcolour.chars().count() == 7 {
        increment = 1;
    } else {
        increment = 0;
    }

    let r_string: String = hexcolour.chars().skip(increment).take(2).collect();
    let g_string: String = hexcolour.chars().skip(increment + 2).take(2).collect();
    let b_string: String = hexcolour.chars().skip(increment + 4).take(2).collect();

    r = i64::from_str_radix(&r_string, 16)? as f64;
    g = i64::from_str_radix(&g_string, 16)? as f64;
    b = i64::from_str_radix(&b_string, 16)? as f64;

    Ok((r, g, b))
}
/// Convert from the HEX color model to the RGB color model.
Convert from the HEX color model to the RGB color model.
Convert from the HEX color model to the RGB color model .
pub fn convert_hex_colour_to_rgb(
    hexcolour: String,
) -> Result<(f64, f64, f64), std::num::ParseIntError> {
    let increment;
    let r: f64;
    let g: f64;
    let b: f64;
    if hexcolour.chars().count() == 7 {
        increment = 1;
    } else {
        increment = 0;
    }
    let r_string: String = hexcolour.chars().skip(increment).take(2).collect();
    let g_string: String = hexcolour.chars().skip(increment + 2).take(2).collect();
    let b_string: String = hexcolour.chars().skip(increment + 4).take(2).collect();
    r = i64::from_str_radix(&r_string, 16)? as f64;
    g = i64::from_str_radix(&g_string, 16)? as f64;
    b = i64::from_str_radix(&b_string, 16)? as f64;
    Ok((r, g, b))
}
pub fn convert_hex_colour_to_rgb ( hexcolour : String , ) -> Result < ( f64 , f64 , f64 ) , std :: num :: ParseIntError > { let increment ; let r : f64 ; let g : f64 ; let b : f64 ; if hexcolour . chars ( ) . count ( ) == 7 { increment = 1 ; } else { increment = 0 ; } let r_string : String = hexcolour . chars ( ) . skip ( increment ) . take ( 2 ) . collect ( ) ; let g_string : String = hexcolour . chars ( ) . skip ( increment + 2 ) . take ( 2 ) . collect ( ) ; let b_string : String = hexcolour . chars ( ) . skip ( increment + 4 ) . take ( 2 ) . collect ( ) ; r = i64 :: from_str_radix ( & r_string , 16 ) ? as f64 ; g = i64 :: from_str_radix ( & g_string , 16 ) ? as f64 ; b = i64 :: from_str_radix ( & b_string , 16 ) ? as f64 ; Ok ( ( r , g , b ) ) }
Convert from the HEX color model to the RGB color model.
Convert from the HEX color model to the RGB color model .
hexcolour
String