From 473055468ab89a68eb7f68c734558ec990ea8a40 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Fri, 13 Jan 2017 21:24:57 +0000 Subject: [PATCH] Docs: ensure alpha attribute is used for transparency --- docs/api-operation.md | 2 +- docs/api-resize.md | 2 +- lib/resize.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api-operation.md b/docs/api-operation.md index c11cef3f6..0bbf01dd1 100644 --- a/docs/api-operation.md +++ b/docs/api-operation.md @@ -169,7 +169,7 @@ This operation will always occur after resizing and extraction, if any. // to the top, left and right edges and 20 to the bottom edge sharp(input) .resize(140) - .background({r: 0, g: 0, b: 0, a: 0}) + .background({r: 0, g: 0, b: 0, alpha: 0}) .extend({top: 10, bottom: 20, left: 10, right: 10}) ... ``` diff --git a/docs/api-resize.md b/docs/api-resize.md index d5886cdc4..89f2e1cb3 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -110,7 +110,7 @@ contain an alpha channel, even when the input image does not. ```javascript sharp('input.gif') .resize(200, 300) - .background({r: 0, g: 0, b: 0, a: 0}) + .background({r: 0, g: 0, b: 0, alpha: 0}) .embed() .toFormat(sharp.format.webp) .toBuffer(function(err, outputBuffer) { diff --git a/lib/resize.js b/lib/resize.js index db60b11b9..34a7e74b7 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -200,7 +200,7 @@ const crop = function crop (crop) { * @example * sharp('input.gif') * .resize(200, 300) - * .background({r: 0, g: 0, b: 0, a: 0}) + * .background({r: 0, g: 0, b: 0, alpha: 0}) * .embed() * .toFormat(sharp.format.webp) * .toBuffer(function(err, outputBuffer) {