jscanvas

a wrapper for the Canvas API

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Passing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install jscanvas
choosenim install jscanvas
git clone https://github.com/planetis-m/jscanvas

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
jscanvas - - - - - - -

Source

Repository https://github.com/planetis-m/jscanvas
Homepage https://github.com/planetis-m/jscanvas
Registry Source nimble_official

README

JsCanvas — A Nim wrapper for the Canvas API

Example

import jscanvas, colors, dom, math

var canvas = document.getElementById("canvas").CanvasElement
canvas.width = 480
canvas.height = 320

var ctx = canvas.getContext2d()

# Draw a ball
var x = canvas.width div 2
var y = canvas.height - 30
var ballRadius = 10

ctx.beginPath()
ctx.arc(x, y, ballRadius, 0, Pi*2)
ctx.fillStyle = $colBlack # could also be: $rgb(0, 0, 0) or just "rgb(0,0,0)"
ctx.fill()
ctx.closePath()