RGB LED Matrix
This library provides a data store for creating shapes, colors, text in order to render in a matrix data store.
⚠️ The HTML5 Matrix simulator is removed from this package starting from v1.0.0
and moved to it's own package.
Install
$ npm install matrix-display-store --save-dev# or$ yarn add matrix-display-store
Usage
;;const store = ;const matrix = canvasElementx: 32y: 16// other options...;matrix;matrix;
Options
Store Methods
store.write(x, y, text, font, size, color)
store.fill(x, y, r, g, b, a)
store.drawPixel(x, y, r, color)
store.drawLine(x1, y1, x2, y2, color)
store.drawFastVLine(x, y, h, color)
store.drawFastHLine(x, y, w, color)
store.drawRect(x, y, w, h, color)
store.drawRoundRect(x, y, w, h, radius, color)
store.drawTriangle(x1, y1, x2, y2, x3, y3, color)
store.drawCircle(x1, y1, radius, color)
store.fillScreen(color | null)
store.fillRect(x, y, w, h, color)
store.fillRoundRect(x, y, w, h, radius, color)
store.fillTriangle(x1, y1, x2, y2, x3, y3, color)
store.fillCirlce(x, y, radius, color)
store.drawBitmap(x, y, bitmap, w, h, color)
Color Tools
The Store
accepts colors in IRGBA
type:
To make working with this object easier, this module exports some color conversion tools:
;Color.hex'#FF0000';Color.hex0xFF0000;Color.rgba255, 255, 255, 05;
License
Licensed under the MIT License