#ifndef SVG_H
#define SVG_H

#include <stdio.h>

// Colors are given as strings, it's easier (hexadecimal is also possible). A few possible colors:
//
//     "black", "white", "gray", "lightgray",
//     "red", "green", "blue", "yellow", "orange", "purple", "pink", "brown",
//     "lightblue", "lightgreen", "lightyellow", "lightpink", "lightsalmon",
//     "darkblue", "darkgreen", "darkred",
// The full list of color names: https://www.w3.org/TR/css-color-3/#svg-color
//
// Typical usage:
//
// FILE *f = svg_open("figure.svg", -1.5, -1.5, 1.5, 1.5);
// if (f == NULL) { /* handle the error */ }
// svg_triangle(f, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, "lightblue");
// svg_point(f, 0.0, 0.0, "red");
// svg_close(f);

FILE *svg_open(const char *filename, double xmin, double ymin, double xmax, double ymax);

void svg_triangle(
    FILE *f, double ax, double ay, double bx, double by, double cx, double cy, const char *fill);

void svg_point(FILE *f, double x, double y, const char *color);

void svg_close(FILE *f);

#endif
