turtle-svg 0.1.1

Turtle graphics, SVG rendering
Documentation
use turtle_svg::{
    turtle::TurtleSvg,
    color::ColorPre
};

fn main() {
    let mut turtle = TurtleSvg::new();
    
    turtle.set_pen_size(5.);
    turtle.set_pen_color(ColorPre::Red);
    turtle.set_background_color(ColorPre::None);

    // Draw a square
    turtle.forward(40.);
    turtle.right(90.);
    turtle.forward(40.);
    turtle.right(90.);
    turtle.forward(40.);
    turtle.right(90.);
    turtle.forward(40.);

    turtle.drawing_mut().set_size((300., 100.));
    turtle.drawing_mut().set_center((20., 20.));
    turtle.drawing_mut().save_svg("image.svg");
}