Allow non-RGB input to embed/extend onto bg with alpha #646

This commit is contained in:
Lovell Fuller
2016-12-11 15:58:20 +00:00
parent 61721bb086
commit d2455267a8
11 changed files with 74 additions and 25 deletions

View File

@@ -29,7 +29,12 @@ const colourspace = {
*/
const background = function background (rgba) {
const colour = color(rgba);
this.options.background = colour.rgb().array().concat(colour.alpha() * 255);
this.options.background = [
colour.red(),
colour.green(),
colour.blue(),
Math.round(colour.alpha() * 255)
];
return this;
};