jscanvas
A Nim wrapper for the Canvas API
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-09-03 07:23 |
Tags
Authors
- Antonis
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 | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 1.0.9 | No |
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()