Upgrade to latest v1.x.x major version of the color dependency.

Uses 'alpha' instead of 'a' to represent transparency values.
This commit is contained in:
Lovell Fuller
2016-12-04 21:04:15 +00:00
parent 850fc9adf9
commit a71e562ff7
4 changed files with 8 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ const colourspace = {
/**
* Set the background for the `embed`, `flatten` and `extend` operations.
* The default background is `{r: 0, g: 0, b: 0, a: 1}`, black without transparency.
* The default background is `{r: 0, g: 0, b: 0, alpha: 1}`, black without transparency.
*
* Delegates to the _color_ module, which can throw an Error
* but is liberal in what it accepts, clipping values to sensible min/max.
@@ -29,8 +29,7 @@ const colourspace = {
*/
const background = function background (rgba) {
const colour = color(rgba);
this.options.background = colour.rgbArray();
this.options.background.push(colour.alpha() * 255);
this.options.background = colour.rgb().array().concat(colour.alpha() * 255);
return this;
};