1.0.2 • Published 8 years ago
dotpic v1.0.2
dotpic
Doc picture generator
Installation
$ npm install dotpic --save
Usage
'use strict'
const dotpic = require('dotpic')
const fs = require('fs')
// Write dot picture
let src = `
000011110000
000001100000
000001100000
000001100000
100001100001
111111111111
111111111111
100001100001
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000011110000
`
let svg = dotpic(src, {
colors: {
'0': '#444',
'1': '#FFF'
}
})
fs.writeFile('my-svg.svg', svg)
Signature
dotpic(src, options) -> string
Params
Name | Type | Description |
---|---|---|
src | string | image data |
options | Object | Optional settings |
options.colors | Object | Color data |
options.width | number | Image width |
options.height | number | Image height |
options.background | string | Background color |
License
This software is released under the MIT License.