Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions __TESTS__/unit/actions/Adjust.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,14 @@ describe('Tests for Transformation Action -- Adjust', () => {
.skinSaturation(10)
.toString()).toBe('e_viesus_correct:skin_saturation_10');
});


it('Tests for Adjust.tint', () => {
let tintVal = 'equalize:80:red:50p:blue:60p:yellow:40p';
expect(Adjust.tint(tintVal).toString()).toBe(`e_tint:${tintVal}`);

tintVal = 'Anything here is just added as a raw string:to the action, with special characters/no validation';
expect(Adjust.tint(tintVal).toString()).toBe(`e_tint:${tintVal}`);
});

});
21 changes: 18 additions & 3 deletions src/actions/adjust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {By3dLutAction} from "./adjust/By3dLutAction";
import {ImproveAction} from "./adjust/ImproveAction";
import {ReplaceColorAction} from "./adjust/ReplaceColorAction";
/**
* Adjusts the visual appearance of an image or video.
* @description Adjusts the visual appearance of an image or video.
* @memberOf Actions
* @namespace Adjust
*/
Expand All @@ -14,6 +14,19 @@ import {ReplaceColorAction} from "./adjust/ReplaceColorAction";



/**
* @memberOf Actions.Adjust
* @description Blends an image with one or more tint colors at a specified intensity. </br>
* You can optionally equalize colors before tinting and specify gradient blend positioning per color.</br>
* <b>Learn more:</b> {@link https://cloudinary.com/documentation/image_transformations#tint_effects | Deliver selected layers of a PSD image}
* @param {string} value The full tint effect value, provided as a string.
* @return {Actions.Effect.SimpleEffectAction}
*/
function tint(value: string): SimpleEffectAction {
return new SimpleEffectAction('tint', value);
}


/**
* @memberOf Actions.Adjust
* @description Adjusts the image or video brightness.
Expand Down Expand Up @@ -212,6 +225,8 @@ import {EffectActionWithLevel} from "./effect/EffectActions/EffectActionWithLeve
import {EffectActionWithStrength} from "./effect/EffectActions/EffectActionWithStrength";
import {EffectActionWithBlend} from "./effect/EffectActions/EffectActionWithBlend";
import {ViesusCorrectAdjustAction} from "./adjust/simple/ViesusCorrectAdjustAction";
import {EffectActions} from "./effect";
import {SimpleEffectAction} from "./effect/EffectActions/SimpleEffectAction";



Expand Down Expand Up @@ -291,9 +306,9 @@ function by3dLut(publicId: string): By3dLutAction {

const Adjust = {brightness, viesusCorrect, opacity, red, sharpen, improve, saturation,
contrast, gamma, green, blue, brightnessHSB, hue, autoBrightness, autoColor,
autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut};
autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut, tint};


export {Adjust, brightness, viesusCorrect, opacity, red, sharpen, improve, saturation,
contrast, gamma, green, blue, brightnessHSB, hue, autoBrightness, autoColor,
autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut};
autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut, tint};