Skip to content

Commit

Permalink
doc(BlendImage): Update Docs (#9876)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanKayeEvolveLab committed May 25, 2024
1 parent 93fe640 commit 8ef6007
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/filters/BlendColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export const blendColorDefaultValues: Partial<TClassProperties<BlendColor>> = {
*
* const filter = new BlendImage({
* image: fabricImageObject,
* mode: 'multiply',
* alpha: 0.5
* mode: 'multiply'
* });
* object.filters.push(filter);
* object.applyFilters();
Expand Down
15 changes: 11 additions & 4 deletions src/filters/BlendImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,27 @@ export const blendImageDefaultValues: Partial<TClassProperties<BlendImage>> = {
*
* const filter = new BlendImage({
* image: fabricImageObject,
* mode: 'multiply',
* alpha: 0.5
* mode: 'multiply'
* });
* object.filters.push(filter);
* object.applyFilters();
* canvas.renderAll();
*/
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;

/**
Expand Down

0 comments on commit 8ef6007

Please sign in to comment.