pub fn multicolor_line(
        &mut self,
        a: Vec2<f32>, b: Vec2<f32>,
        width: f32, 
        color_a: Color, color_b: Color
    ) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid));

        let normal = (b - a).normalize().left() * (width / 2.0);
        let uv = Vec2::ZERO;
        self.add_vertices(&[
            Vert { pos: a - normal, uv, color: color_a },
            Vert { pos: b - normal, uv, color: color_b },
            Vert { pos: b + normal, uv, color: color_b },
            Vert { pos: a - normal, uv, color: color_a },
            Vert { pos: b + normal, uv, color: color_b },
            Vert { pos: a + normal, uv, color: color_a },
        ]);
    }
/// Draws a thick line which starts with one color and transitions to another color.
Draws a thick line which starts with one color and transitions to another color.
Draws a thick line which starts with one color and transitions to another color .
pub fn multicolor_line(
        &mut self,
        a: Vec2<f32>, b: Vec2<f32>,
        width: f32, 
        color_a: Color, color_b: Color
    ) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid));
        let normal = (b - a).normalize().left() * (width / 2.0);
        let uv = Vec2::ZERO;
        self.add_vertices(&[
            Vert { pos: a - normal, uv, color: color_a },
            Vert { pos: b - normal, uv, color: color_b },
            Vert { pos: b + normal, uv, color: color_b },
            Vert { pos: a - normal, uv, color: color_a },
            Vert { pos: b + normal, uv, color: color_b },
            Vert { pos: a + normal, uv, color: color_a },
        ]);
    }
pub fn multicolor_line ( & mut self , a : Vec2 < f32 > , b : Vec2 < f32 > , width : f32 , color_a : Color , color_b : Color ) { self . push_state_cmd ( StateCmd :: TextureChange ( SamplerId :: Solid ) ) ; let normal = ( b - a ) . normalize ( ) . left ( ) * ( width / 2.0 ) ; let uv = Vec2 :: ZERO ; self . add_vertices ( & [ Vert { pos : a - normal , uv , color : color_a } , Vert { pos : b - normal , uv , color : color_b } , Vert { pos : b + normal , uv , color : color_b } , Vert { pos : a - normal , uv , color : color_a } , Vert { pos : b + normal , uv , color : color_b } , Vert { pos : a + normal , uv , color : color_a } , ] ) ; }
Draws a thick line which starts with one color and transitions to another color.
Draws a thick line which starts with one color and transitions to another color .
&mut self
a
Vec2<f32>
b
Vec2<f32>
width
f32
color_a
Color
color_b
Color
&mut self
a
Vec2<f32>
b
Vec2<f32>
width
f32
color_a
Color
color_b
Color