From f903e1465e2f8cce8de1c0bc01ef79631800aa51 Mon Sep 17 00:00:00 2001 From: Oleg Andreyev Date: Tue, 17 May 2022 17:40:11 +0300 Subject: [PATCH] Docs: clarify wording of resize background option --- docs/api-resize.md | 2 +- lib/resize.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-resize.md b/docs/api-resize.md index 970bee4f2..59ec8ddd8 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -46,7 +46,7 @@ Possible interpolation kernels are: * `options.height` **[String][10]?** alternative means of specifying `height`. If both are present this take priority. * `options.fit` **[String][10]** how the image should be resized to fit both provided dimensions, one of `cover`, `contain`, `fill`, `inside` or `outside`. (optional, default `'cover'`) * `options.position` **[String][10]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`) - * `options.background` **([String][10] | [Object][9])** background colour when using a `fit` of `contain`, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`) + * `options.background` **([String][10] | [Object][9])** background colour when `fit` is `contain`, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`) * `options.kernel` **[String][10]** the kernel to use for image reduction. (optional, default `'lanczos3'`) * `options.withoutEnlargement` **[Boolean][12]** do not enlarge if the width *or* height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. (optional, default `false`) * `options.withoutReduction` **[Boolean][12]** do not reduce if the width *or* height are already greater than the specified dimensions, equivalent to GraphicsMagick's `<` geometry option. (optional, default `false`) diff --git a/lib/resize.js b/lib/resize.js index fd69535f0..6bc197c1e 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -211,7 +211,7 @@ function isRotationExpected (options) { * @param {String} [options.height] - alternative means of specifying `height`. If both are present this take priority. * @param {String} [options.fit='cover'] - how the image should be resized to fit both provided dimensions, one of `cover`, `contain`, `fill`, `inside` or `outside`. * @param {String} [options.position='centre'] - position, gravity or strategy to use when `fit` is `cover` or `contain`. - * @param {String|Object} [options.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour when using a `fit` of `contain`, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency. + * @param {String|Object} [options.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour when `fit` is `contain`, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency. * @param {String} [options.kernel='lanczos3'] - the kernel to use for image reduction. * @param {Boolean} [options.withoutEnlargement=false] - do not enlarge if the width *or* height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. * @param {Boolean} [options.withoutReduction=false] - do not reduce if the width *or* height are already greater than the specified dimensions, equivalent to GraphicsMagick's `<` geometry option.