UNPKG

@cloudinary/url-gen

Version:

Cloudinary URL-Gen SDK ========================= [![Build Status](https://api.travis-ci.com/cloudinary/js-url-gen.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/js-url-gen) ## About The Cloudinary URL-Gen SDK allows you to quickly and eas

44 lines (40 loc) 1.3 kB
'use strict'; var BackgroundQualifier = require('./BackgroundQualifier-ab682c8f.cjs'); /** * @description A class for blurred background transformations. * @memberOf Qualifiers.Background * @extends {Qualifiers.Background.BackgroundQualifier} */ class BlurredBackgroundAction extends BackgroundQualifier.BackgroundQualifier { /** * @description Sets the intensity of the blur. * @param {number} value - The intensity of the blur. */ intensity(value) { this.intensityLevel = value; return this; } /** * @description Sets the brightness of the background. * @param {number} value - The brightness of the background. */ brightness(value) { this.brightnessLevel = value; return this; } /** * @description * Stringify the qualifier * BackgroundQualifiers don't have a value, but instead override the toString() function */ toString() { // b_blurred:{intensity}:{brightness} return ` b_blurred ${this.intensityLevel ? `:${this.intensityLevel}` : ''} ${this.brightnessLevel ? `:${this.brightnessLevel}` : ''} `.replace(/\s+/g, ''); } } var BlurredBackgroundAction$1 = BlurredBackgroundAction; exports.BlurredBackgroundAction = BlurredBackgroundAction$1;