SimpleKit

Learned and used in CS349.

Simplest thing

import { startSimpleKit, setSKDrawCallback } from "simplekit/canvas-mode";
 
startSimpleKit();
 
setSKDrawCallback((gc) => {
  gc.clearRect(0, 0, gc.canvas.width, gc.canvas.height);
  // Insert functions here
  rectangleDemo(gc);
  pathDemo(gc);
  pathHouseDemo(gc);
});

You can save states and later restore them

  gc.save();
 
  gc.fillStyle = "yellow";
  gc.strokeStyle = "black";
  gc.lineWidth = 2;
  circle(110, 50);
 
  gc.restore();