From 8ef6007551190e596e98f71c96fc96e35e447864 Mon Sep 17 00:00:00 2001 From: DanKayeEvolveLab <108761462+DanKayeEvolveLab@users.noreply.github.com> Date: Sat, 25 May 2024 01:25:07 -0600 Subject: [PATCH] doc(BlendImage): Update Docs (#9876) --- CHANGELOG.md | 1 + src/filters/BlendColor.ts | 3 +-- src/filters/BlendImage.ts | 15 +++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d4b20e17e8..f0a028d3612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- docs(): Improve JSDOCs for BlendImage [#9876](https://github.com/fabricjs/fabric.js/pull/9876) - fix(Group): Pass down the abort signal from group to objects [#9890](https://github.com/fabricjs/fabric.js/pull/9890) - fix(util): restore old composeMatrix code for performances improvement [#9851](https://github.com/fabricjs/fabric.js/pull/9851) - fix(Control): corner coords definition order [#9884](https://github.com/fabricjs/fabric.js/pull/9884) diff --git a/src/filters/BlendColor.ts b/src/filters/BlendColor.ts index fcd30b5e0ee..8a134d6ed4b 100644 --- a/src/filters/BlendColor.ts +++ b/src/filters/BlendColor.ts @@ -33,8 +33,7 @@ export const blendColorDefaultValues: Partial> = { * * const filter = new BlendImage({ * image: fabricImageObject, - * mode: 'multiply', - * alpha: 0.5 + * mode: 'multiply' * }); * object.filters.push(filter); * object.applyFilters(); diff --git a/src/filters/BlendImage.ts b/src/filters/BlendImage.ts index 45384955212..d28ac532c09 100644 --- a/src/filters/BlendImage.ts +++ b/src/filters/BlendImage.ts @@ -39,8 +39,7 @@ export const blendImageDefaultValues: Partial> = { * * const filter = new BlendImage({ * image: fabricImageObject, - * mode: 'multiply', - * alpha: 0.5 + * mode: 'multiply' * }); * object.filters.push(filter); * object.applyFilters(); @@ -48,11 +47,19 @@ export const blendImageDefaultValues: Partial> = { */ export class BlendImage extends BaseFilter { /** - * Color to make the blend operation with. default to a reddish color since black or white - * gives always strong result. + * Image to make the blend operation with. **/ declare image: FabricImage; + /** + * Blend mode for the filter: either 'multiply' or 'mask'. 'multiply' will + * multiply the values of each channel (R, G, B, and A) of the filter image by + * their corresponding values in the base image. 'mask' will only look at the + * alpha channel of the filter image, and apply those values to the base + * image's alpha channel. + * @type String + * @default + **/ declare mode: TBlendImageMode; /**