Skip to content

Commit 8ef6007

Browse files
doc(BlendImage): Update Docs (#9876)
1 parent 93fe640 commit 8ef6007

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [next]
44

5+
- docs(): Improve JSDOCs for BlendImage [#9876](https://github.com/fabricjs/fabric.js/pull/9876)
56
- fix(Group): Pass down the abort signal from group to objects [#9890](https://github.com/fabricjs/fabric.js/pull/9890)
67
- fix(util): restore old composeMatrix code for performances improvement [#9851](https://github.com/fabricjs/fabric.js/pull/9851)
78
- fix(Control): corner coords definition order [#9884](https://github.com/fabricjs/fabric.js/pull/9884)

src/filters/BlendColor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ export const blendColorDefaultValues: Partial<TClassProperties<BlendColor>> = {
3333
*
3434
* const filter = new BlendImage({
3535
* image: fabricImageObject,
36-
* mode: 'multiply',
37-
* alpha: 0.5
36+
* mode: 'multiply'
3837
* });
3938
* object.filters.push(filter);
4039
* object.applyFilters();

src/filters/BlendImage.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,27 @@ export const blendImageDefaultValues: Partial<TClassProperties<BlendImage>> = {
3939
*
4040
* const filter = new BlendImage({
4141
* image: fabricImageObject,
42-
* mode: 'multiply',
43-
* alpha: 0.5
42+
* mode: 'multiply'
4443
* });
4544
* object.filters.push(filter);
4645
* object.applyFilters();
4746
* canvas.renderAll();
4847
*/
4948
export class BlendImage extends BaseFilter {
5049
/**
51-
* Color to make the blend operation with. default to a reddish color since black or white
52-
* gives always strong result.
50+
* Image to make the blend operation with.
5351
**/
5452
declare image: FabricImage;
5553

54+
/**
55+
* Blend mode for the filter: either 'multiply' or 'mask'. 'multiply' will
56+
* multiply the values of each channel (R, G, B, and A) of the filter image by
57+
* their corresponding values in the base image. 'mask' will only look at the
58+
* alpha channel of the filter image, and apply those values to the base
59+
* image's alpha channel.
60+
* @type String
61+
* @default
62+
**/
5663
declare mode: TBlendImageMode;
5764

5865
/**

0 commit comments

Comments
 (0)