rexpaintjs

0.1.2 • Public • Published

rexpaintjs

A library to load REXPaint "XP" files as plain javascript objects.

Usage:

npm install --save rexpaintjs
const rexpaintjs = require('rexpaintjs')
 
// Callback form
rexpaintjs.fromBuffer(yourBuffer, (err, data) => {
  ...
})
 
// Async form
let ob = await rexpaintjs.fromBuffer(yourBuffer)
 
// Ob has the following form
 
{
  version: integer, // Usually -1
  layers: [
    array of plain objects with layer data
  ]
}
 
// Layer object
{
  width: integer,
  height: integer,
  raster: [
    column major array of pixel data
  ]
}
 
// Pixel data
{
  asciiCode: integer,
  transparent: boolean,
  fg: color object,
  bg: color object
}
 
// Color object
{
  r: integer,
  g: integer,
  b: integer,
  hex: string // Plain hex, if you want to use it for css or html prepend the #
}

License:

Read LICENSE

tl;dr: ISC License

Readme

Keywords

none

Package Sidebar

Install

npm i rexpaintjs

Weekly Downloads

0

Version

0.1.2

License

ISC

Unpacked Size

7.2 kB

Total Files

7

Last publish

Collaborators

  • chiguireitor