Docs: ensure alpha attribute is used for transparency

This commit is contained in:
Lovell Fuller 2017-01-13 21:24:57 +00:00
parent c6a28db8b1
commit 473055468a
3 changed files with 3 additions and 3 deletions

View File

@ -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 // to the top, left and right edges and 20 to the bottom edge
sharp(input) sharp(input)
.resize(140) .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}) .extend({top: 10, bottom: 20, left: 10, right: 10})
... ...
``` ```

View File

@ -110,7 +110,7 @@ contain an alpha channel, even when the input image does not.
```javascript ```javascript
sharp('input.gif') sharp('input.gif')
.resize(200, 300) .resize(200, 300)
.background({r: 0, g: 0, b: 0, a: 0}) .background({r: 0, g: 0, b: 0, alpha: 0})
.embed() .embed()
.toFormat(sharp.format.webp) .toFormat(sharp.format.webp)
.toBuffer(function(err, outputBuffer) { .toBuffer(function(err, outputBuffer) {

View File

@ -200,7 +200,7 @@ const crop = function crop (crop) {
* @example * @example
* sharp('input.gif') * sharp('input.gif')
* .resize(200, 300) * .resize(200, 300)
* .background({r: 0, g: 0, b: 0, a: 0}) * .background({r: 0, g: 0, b: 0, alpha: 0})
* .embed() * .embed()
* .toFormat(sharp.format.webp) * .toFormat(sharp.format.webp)
* .toBuffer(function(err, outputBuffer) { * .toBuffer(function(err, outputBuffer) {