mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
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:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user