From 2de062a34af0694c5f4a00fd3552ae776efe5645 Mon Sep 17 00:00:00 2001 From: thegareth Date: Thu, 2 Aug 2018 09:42:25 +0100 Subject: [PATCH] Docs: update the "make a transparent image" example (#1316) Alpha for colour is between 0-1, not 0-255. --- docs/api-constructor.md | 2 +- lib/constructor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-constructor.md b/docs/api-constructor.md index f13ad181..140d3c7c 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -55,7 +55,7 @@ sharp({ width: 300, height: 200, channels: 4, - background: { r: 255, g: 0, b: 0, alpha: 128 } + background: { r: 255, g: 0, b: 0, alpha: 0.5 } } }) .png() diff --git a/lib/constructor.js b/lib/constructor.js index 60f1de7c..8d27d761 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -81,7 +81,7 @@ const debuglog = util.debuglog('sharp'); * width: 300, * height: 200, * channels: 4, - * background: { r: 255, g: 0, b: 0, alpha: 128 } + * background: { r: 255, g: 0, b: 0, alpha: 0.5 } * } * }) * .png()