Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

opts.padding

  • Loading branch information...
commit d1020ea069245fae7909f0de43a4e2dfe121bc6e 1 parent 8889bb9
@substack authored
Showing with 4 additions and 3 deletions.
  1. +3 −2 index.js
  2. +1 −1  package.json
View
5 index.js
@@ -7,12 +7,13 @@ module.exports = function art (src, opts) {
if (!opts.width) opts.width = 6;
if (!opts.colors) opts.colors = {};
if (!opts.left) opts.left = 0;
+ if (!opts.padding) opts.padding = 50;
if (Array.isArray(src)) {
var size = src.slice(1).reduce(function (acc, s) {
var size = imageSize(s, opts);
return {
- width : acc.width + size.width + 50,
+ width : acc.width + size.width + opts.padding,
height : Math.max(acc.height, size.height),
};
}, imageSize(src[0], opts));
@@ -25,7 +26,7 @@ module.exports = function art (src, opts) {
draw(canvas, s, opts);
var size = imageSize(s, opts);
- left += size.width + 50;
+ left += size.width + opts.padding;
});
return canvas.createPNGStream();
View
2  package.json
@@ -1,6 +1,6 @@
{
"name" : "code-art",
- "version" : "0.0.0",
+ "version" : "0.1.0",
"description" : "create blocky modern art from code",
"main" : "index.js",
"directories" : {
Please sign in to comment.
Something went wrong with that request. Please try again.