From 93a90edde231a2133b211aa9d79a3f563b03227d Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 14 May 2019 00:22:57 +0200 Subject: [PATCH] fix(sharp): add missing modulate type (#35253) --- types/sharp/index.d.ts | 7 +++++++ types/sharp/sharp-tests.ts | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index 3f8acea600..9b9957fef7 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -434,6 +434,13 @@ declare namespace sharp { */ recomb(inputMatrix: Matrix3x3): Sharp; + /** + * Transforms the image using brightness, saturation and hue rotation. + * @param options describes the modulation + * @returns A sharp instance that can be used to chain operations + */ + modulate(options?: { brightness?: number, saturation?: number, hue?: number }): Sharp; + //#endregion //#region Output functions diff --git a/types/sharp/sharp-tests.ts b/types/sharp/sharp-tests.ts index b313ea69c3..c884627979 100644 --- a/types/sharp/sharp-tests.ts +++ b/types/sharp/sharp-tests.ts @@ -244,4 +244,8 @@ sharp('input.gif') [0.2990, 0.5870, 0.1140], [0.2392, 0.4696, 0.0912], ]) + + .modulate({ brightness: 2 }) + .modulate({ hue: 180 }) + .modulate({ brightness: 0.5, saturation: 0.5, hue: 90 }) ;