mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Allow non-RGB input to embed/extend onto bg with alpha #646
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user