A lightweight (17 KB minified) yet powerful cross platform graphics library inspired by Processing
Drawlite has a JavaScript implementation for drawing graphics in web browsers and a Dart implementation for drawing graphics natively. The Dart implementation relies on my dcanvas library which is a native implementation of HTML Canvas in Dart.
You can find example usage in demo.html in the javascript directory and demo.dart in the dart directory.
let DL = Drawlite(canvas);
let { size, fill, rect, get } = DL;
size(400, 400);
DL.draw = function () {
fill(255, 0, 0);
rect(get.mouseX, get.mouseY, 100, 100);
};import 'package:dcanvas/dcanvas.dart' show Canvas;
import '../drawlite/drawlite.dart'
show Drawlite;
import '../drawlite/dl.dart';
void main() {
var canvas = Canvas(400, 400);
var dl = Drawlite(canvas);
fill = dl.fill;
rect = dl.rect;
get = dl.get;
fill(255, 0, 0);
rect(get.mouseX, get.mouseY, 100, 100);
}View the documentation in the docs.md file.
The Dart version of drawlite uses jvbuild to manage its dependencies. Install jvbuild and run jvbuild get.
Run the demo via jvbuild run demo.