pub fn mix_color(&self, a: &[u8;4], b: &[u8;4], v: f64) -> [u8; 4] {
        [   (((1.0 - v) * (a[0] as f64 / 255.0) + b[0] as f64 / 255.0 * v) * 255.0) as u8,
            (((1.0 - v) * (a[1] as f64 / 255.0) + b[1] as f64 / 255.0 * v) * 255.0) as u8,
            (((1.0 - v) * (a[2] as f64 / 255.0) + b[2] as f64 / 255.0 * v) * 255.0) as u8,
        255]
    }
/// Mixes two colors based on v
Mixes two colors based on v
Mixes two colors based on v
pub fn mix_color(&self, a: &[u8;4], b: &[u8;4], v: f64) -> [u8; 4] {
        [   (((1.0 - v) * (a[0] as f64 / 255.0) + b[0] as f64 / 255.0 * v) * 255.0) as u8,
            (((1.0 - v) * (a[1] as f64 / 255.0) + b[1] as f64 / 255.0 * v) * 255.0) as u8,
            (((1.0 - v) * (a[2] as f64 / 255.0) + b[2] as f64 / 255.0 * v) * 255.0) as u8,
        255]
    }
pub fn mix_color ( & self , a : & [ u8 ; 4 ] , b : & [ u8 ; 4 ] , v : f64 ) -> [ u8 ; 4 ] { [ ( ( ( 1.0 - v ) * ( a [ 0 ] as f64 / 255.0 ) + b [ 0 ] as f64 / 255.0 * v ) * 255.0 ) as u8 , ( ( ( 1.0 - v ) * ( a [ 1 ] as f64 / 255.0 ) + b [ 1 ] as f64 / 255.0 * v ) * 255.0 ) as u8 , ( ( ( 1.0 - v ) * ( a [ 2 ] as f64 / 255.0 ) + b [ 2 ] as f64 / 255.0 * v ) * 255.0 ) as u8 , 255 ] }
Mixes two colors based on v
Mixes two colors based on v
&self
a
&[u8;4]
b
&[u8;4]
v
f64
&self
a
&[u8;4]
b
&[u8;4]
v
f64