How to use normalizeBlendMode method in wpt

Best JavaScript code snippet using wpt

evaluator.js

Source:evaluator.js Github

copy

Full Screen

...119 this.endTime = Date.now() + TIME_SLOT_DURATION_MS;120 this.checked = 0;121 }122 };123 function normalizeBlendMode(value, parsingArray = false) {124 if (Array.isArray(value)) {125 for (let i = 0, ii = value.length; i < ii; i++) {126 const maybeBM = normalizeBlendMode(value[i], true);127 if (maybeBM) {128 return maybeBM;129 }130 }131 (0, _util.warn)(`Unsupported blend mode Array: ${value}`);132 return "source-over";133 }134 if (!(0, _primitives.isName)(value)) {135 if (parsingArray) {136 return null;137 }138 return "source-over";139 }140 switch (value.name) {141 case "Normal":142 case "Compatible":143 return "source-over";144 case "Multiply":145 return "multiply";146 case "Screen":147 return "screen";148 case "Overlay":149 return "overlay";150 case "Darken":151 return "darken";152 case "Lighten":153 return "lighten";154 case "ColorDodge":155 return "color-dodge";156 case "ColorBurn":157 return "color-burn";158 case "HardLight":159 return "hard-light";160 case "SoftLight":161 return "soft-light";162 case "Difference":163 return "difference";164 case "Exclusion":165 return "exclusion";166 case "Hue":167 return "hue";168 case "Saturation":169 return "saturation";170 case "Color":171 return "color";172 case "Luminosity":173 return "luminosity";174 }175 if (parsingArray) {176 return null;177 }178 (0, _util.warn)(`Unsupported blend mode: ${value.name}`);179 return "source-over";180 }181 var deferred = Promise.resolve();182 var TILING_PATTERN = 1,183 SHADING_PATTERN = 2;184 PartialEvaluator.prototype = {185 clone(newOptions = DefaultPartialEvaluatorOptions) {186 var newEvaluator = Object.create(this);187 newEvaluator.options = newOptions;188 return newEvaluator;189 },190 hasBlendModes: function PartialEvaluator_hasBlendModes(resources) {191 if (!(resources instanceof _primitives.Dict)) {192 return false;193 }194 var processed = Object.create(null);195 if (resources.objId) {196 processed[resources.objId] = true;197 }198 var nodes = [resources],199 xref = this.xref;200 while (nodes.length) {201 var node = nodes.shift();202 var graphicStates = node.get("ExtGState");203 if (graphicStates instanceof _primitives.Dict) {204 var graphicStatesKeys = graphicStates.getKeys();205 for (let i = 0, ii = graphicStatesKeys.length; i < ii; i++) {206 const key = graphicStatesKeys[i];207 let graphicState = graphicStates.getRaw(key);208 if (graphicState instanceof _primitives.Ref) {209 if (processed[graphicState.toString()]) {210 continue;211 }212 try {213 graphicState = xref.fetch(graphicState);214 } catch (ex) {215 if (ex instanceof _core_utils.MissingDataException) {216 throw ex;217 }218 if (this.options.ignoreErrors) {219 if (graphicState instanceof _primitives.Ref) {220 processed[graphicState.toString()] = true;221 }222 this.handler.send("UnsupportedFeature", {223 featureId: _util.UNSUPPORTED_FEATURES.unknown224 });225 (0, _util.warn)(`hasBlendModes - ignoring ExtGState: "${ex}".`);226 continue;227 }228 throw ex;229 }230 }231 if (!(graphicState instanceof _primitives.Dict)) {232 continue;233 }234 if (graphicState.objId) {235 processed[graphicState.objId] = true;236 }237 const bm = graphicState.get("BM");238 if (bm instanceof _primitives.Name) {239 if (bm.name !== "Normal") {240 return true;241 }242 continue;243 }244 if (bm !== undefined && Array.isArray(bm)) {245 for (let j = 0, jj = bm.length; j < jj; j++) {246 if (bm[j] instanceof _primitives.Name && bm[j].name !== "Normal") {247 return true;248 }249 }250 }251 }252 }253 var xObjects = node.get("XObject");254 if (!(xObjects instanceof _primitives.Dict)) {255 continue;256 }257 var xObjectsKeys = xObjects.getKeys();258 for (let i = 0, ii = xObjectsKeys.length; i < ii; i++) {259 const key = xObjectsKeys[i];260 var xObject = xObjects.getRaw(key);261 if (xObject instanceof _primitives.Ref) {262 if (processed[xObject.toString()]) {263 continue;264 }265 try {266 xObject = xref.fetch(xObject);267 } catch (ex) {268 if (ex instanceof _core_utils.MissingDataException) {269 throw ex;270 }271 if (this.options.ignoreErrors) {272 if (xObject instanceof _primitives.Ref) {273 processed[xObject.toString()] = true;274 }275 this.handler.send("UnsupportedFeature", {276 featureId: _util.UNSUPPORTED_FEATURES.unknown277 });278 (0, _util.warn)(`hasBlendModes - ignoring XObject: "${ex}".`);279 continue;280 }281 throw ex;282 }283 }284 if (!(0, _primitives.isStream)(xObject)) {285 continue;286 }287 if (xObject.dict.objId) {288 if (processed[xObject.dict.objId]) {289 continue;290 }291 processed[xObject.dict.objId] = true;292 }293 var xResources = xObject.dict.get("Resources");294 if (xResources instanceof _primitives.Dict && (!xResources.objId || !processed[xResources.objId])) {295 nodes.push(xResources);296 if (xResources.objId) {297 processed[xResources.objId] = true;298 }299 }300 }301 }302 return false;303 },304 async buildFormXObject(resources, xobj, smask, operatorList, task, initialState) {305 var dict = xobj.dict;306 var matrix = dict.getArray("Matrix");307 var bbox = dict.getArray("BBox");308 if (Array.isArray(bbox) && bbox.length === 4) {309 bbox = _util.Util.normalizeRect(bbox);310 } else {311 bbox = null;312 }313 var group = dict.get("Group");314 if (group) {315 var groupOptions = {316 matrix,317 bbox,318 smask,319 isolated: false,320 knockout: false321 };322 var groupSubtype = group.get("S");323 var colorSpace = null;324 if ((0, _primitives.isName)(groupSubtype, "Transparency")) {325 groupOptions.isolated = group.get("I") || false;326 groupOptions.knockout = group.get("K") || false;327 if (group.has("CS")) {328 colorSpace = await this.parseColorSpace({329 cs: group.get("CS"),330 resources331 });332 }333 }334 if (smask && smask.backdrop) {335 colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb;336 smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);337 }338 operatorList.addOp(_util.OPS.beginGroup, [groupOptions]);339 }340 operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]);341 return this.getOperatorList({342 stream: xobj,343 task,344 resources: dict.get("Resources") || resources,345 operatorList,346 initialState347 }).then(function () {348 operatorList.addOp(_util.OPS.paintFormXObjectEnd, []);349 if (group) {350 operatorList.addOp(_util.OPS.endGroup, [groupOptions]);351 }352 });353 },354 async buildPaintImageXObject({355 resources,356 image,357 isInline = false,358 operatorList,359 cacheKey,360 imageCache,361 forceDisableNativeImageDecoder = false362 }) {363 var dict = image.dict;364 var w = dict.get("Width", "W");365 var h = dict.get("Height", "H");366 if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) {367 (0, _util.warn)("Image dimensions are missing, or not numbers.");368 return undefined;369 }370 var maxImageSize = this.options.maxImageSize;371 if (maxImageSize !== -1 && w * h > maxImageSize) {372 (0, _util.warn)("Image exceeded maximum allowed size and was removed.");373 return undefined;374 }375 var imageMask = dict.get("ImageMask", "IM") || false;376 var imgData, args;377 if (imageMask) {378 var width = dict.get("Width", "W");379 var height = dict.get("Height", "H");380 var bitStrideLength = width + 7 >> 3;381 var imgArray = image.getBytes(bitStrideLength * height, true);382 var decode = dict.getArray("Decode", "D");383 imgData = _image.PDFImage.createMask({384 imgArray,385 width,386 height,387 imageIsFromDecodeStream: image instanceof _stream.DecodeStream,388 inverseDecode: !!decode && decode[0] > 0389 });390 imgData.cached = !!cacheKey;391 args = [imgData];392 operatorList.addOp(_util.OPS.paintImageMaskXObject, args);393 if (cacheKey) {394 imageCache[cacheKey] = {395 fn: _util.OPS.paintImageMaskXObject,396 args397 };398 }399 return undefined;400 }401 var softMask = dict.get("SMask", "SM") || false;402 var mask = dict.get("Mask") || false;403 var SMALL_IMAGE_DIMENSIONS = 200;404 if (isInline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) {405 const imageObj = new _image.PDFImage({406 xref: this.xref,407 res: resources,408 image,409 isInline,410 pdfFunctionFactory: this.pdfFunctionFactory411 });412 imgData = imageObj.createImageData(true);413 operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]);414 return undefined;415 }416 const nativeImageDecoderSupport = forceDisableNativeImageDecoder ? _util.NativeImageDecoding.NONE : this.options.nativeImageDecoderSupport;417 let objId = `img_${this.idFactory.createObjId()}`;418 if (this.parsingType3Font) {419 (0, _util.assert)(nativeImageDecoderSupport === _util.NativeImageDecoding.NONE, "Type3 image resources should be completely decoded in the worker.");420 objId = `${this.idFactory.getDocId()}_type3res_${objId}`;421 }422 if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && _image_utils.NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory) && image.maybeValidDimensions) {423 return this.handler.sendWithPromise("obj", [objId, this.pageIndex, "JpegStream", image.getIR(this.options.forceDataSchema)]).then(function () {424 operatorList.addDependency(objId);425 args = [objId, w, h];426 operatorList.addOp(_util.OPS.paintJpegXObject, args);427 if (cacheKey) {428 imageCache[cacheKey] = {429 fn: _util.OPS.paintJpegXObject,430 args431 };432 }433 }, reason => {434 (0, _util.warn)("Native JPEG decoding failed -- trying to recover: " + (reason && reason.message));435 return this.buildPaintImageXObject({436 resources,437 image,438 isInline,439 operatorList,440 cacheKey,441 imageCache,442 forceDisableNativeImageDecoder: true443 });444 });445 }446 var nativeImageDecoder = null;447 if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) {448 nativeImageDecoder = new _image_utils.NativeImageDecoder({449 xref: this.xref,450 resources,451 handler: this.handler,452 forceDataSchema: this.options.forceDataSchema,453 pdfFunctionFactory: this.pdfFunctionFactory454 });455 }456 operatorList.addDependency(objId);457 args = [objId, w, h];458 const imgPromise = _image.PDFImage.buildImage({459 handler: this.handler,460 xref: this.xref,461 res: resources,462 image,463 isInline,464 nativeDecoder: nativeImageDecoder,465 pdfFunctionFactory: this.pdfFunctionFactory466 }).then(imageObj => {467 var imgData = imageObj.createImageData(false);468 if (this.parsingType3Font) {469 return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", imgData], [imgData.data.buffer]);470 }471 this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], [imgData.data.buffer]);472 return undefined;473 }).catch(reason => {474 (0, _util.warn)("Unable to decode image: " + reason);475 if (this.parsingType3Font) {476 return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", null]);477 }478 this.handler.send("obj", [objId, this.pageIndex, "Image", null]);479 return undefined;480 });481 if (this.parsingType3Font) {482 await imgPromise;483 }484 operatorList.addOp(_util.OPS.paintImageXObject, args);485 if (cacheKey) {486 imageCache[cacheKey] = {487 fn: _util.OPS.paintImageXObject,488 args489 };490 }491 return undefined;492 },493 handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) {494 var smaskContent = smask.get("G");495 var smaskOptions = {496 subtype: smask.get("S").name,497 backdrop: smask.get("BC")498 };499 var transferObj = smask.get("TR");500 if ((0, _function.isPDFFunction)(transferObj)) {501 const transferFn = this.pdfFunctionFactory.create(transferObj);502 var transferMap = new Uint8Array(256);503 var tmp = new Float32Array(1);504 for (var i = 0; i < 256; i++) {505 tmp[0] = i / 255;506 transferFn(tmp, 0, tmp, 0);507 transferMap[i] = tmp[0] * 255 | 0;508 }509 smaskOptions.transferMap = transferMap;510 }511 return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone());512 },513 handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) {514 const tilingOpList = new _operator_list.OperatorList();515 const resourcesArray = [patternDict.get("Resources"), resources];516 const patternResources = _primitives.Dict.merge(this.xref, resourcesArray);517 return this.getOperatorList({518 stream: pattern,519 task,520 resources: patternResources,521 operatorList: tilingOpList522 }).then(function () {523 return (0, _pattern.getTilingPatternIR)({524 fnArray: tilingOpList.fnArray,525 argsArray: tilingOpList.argsArray526 }, patternDict, args);527 }).then(function (tilingPatternIR) {528 operatorList.addDependencies(tilingOpList.dependencies);529 operatorList.addOp(fn, tilingPatternIR);530 }, reason => {531 if (reason instanceof _util.AbortException) {532 return;533 }534 if (this.options.ignoreErrors) {535 this.handler.send("UnsupportedFeature", {536 featureId: _util.UNSUPPORTED_FEATURES.unknown537 });538 (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`);539 return;540 }541 throw reason;542 });543 },544 handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) {545 var fontName;546 if (fontArgs) {547 fontArgs = fontArgs.slice();548 fontName = fontArgs[0].name;549 }550 return this.loadFont(fontName, fontRef, resources).then(translated => {551 if (!translated.font.isType3Font) {552 return translated;553 }554 return translated.loadType3Data(this, resources, operatorList, task).then(function () {555 return translated;556 }).catch(reason => {557 this.handler.send("UnsupportedFeature", {558 featureId: _util.UNSUPPORTED_FEATURES.font559 });560 return new TranslatedFont("g_font_error", new _fonts.ErrorFont("Type3 font load error: " + reason), translated.font);561 });562 }).then(translated => {563 state.font = translated.font;564 translated.send(this.handler);565 return translated.loadedName;566 });567 },568 handleText(chars, state) {569 const font = state.font;570 const glyphs = font.charsToGlyphs(chars);571 if (font.data) {572 const isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG);573 if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) {574 PartialEvaluator.buildFontPaths(font, glyphs, this.handler);575 }576 }577 return glyphs;578 },579 ensureStateFont(state) {580 if (state.font) {581 return;582 }583 const reason = new _util.FormatError("Missing setFont (Tf) operator before text rendering operator.");584 if (this.options.ignoreErrors) {585 this.handler.send("UnsupportedFeature", {586 featureId: _util.UNSUPPORTED_FEATURES.font587 });588 (0, _util.warn)(`ensureStateFont: "${reason}".`);589 return;590 }591 throw reason;592 },593 setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) {594 var gStateObj = [];595 var gStateKeys = gState.getKeys();596 var promise = Promise.resolve();597 for (var i = 0, ii = gStateKeys.length; i < ii; i++) {598 const key = gStateKeys[i];599 const value = gState.get(key);600 switch (key) {601 case "Type":602 break;603 case "LW":604 case "LC":605 case "LJ":606 case "ML":607 case "D":608 case "RI":609 case "FL":610 case "CA":611 case "ca":612 gStateObj.push([key, value]);613 break;614 case "Font":615 promise = promise.then(() => {616 return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {617 operatorList.addDependency(loadedName);618 gStateObj.push([key, [loadedName, value[1]]]);619 });620 });621 break;622 case "BM":623 gStateObj.push([key, normalizeBlendMode(value)]);624 break;625 case "SMask":626 if ((0, _primitives.isName)(value, "None")) {627 gStateObj.push([key, false]);628 break;629 }630 if ((0, _primitives.isDict)(value)) {631 promise = promise.then(() => {632 return this.handleSMask(value, resources, operatorList, task, stateManager);633 });634 gStateObj.push([key, true]);635 } else {636 (0, _util.warn)("Unsupported SMask type");637 }...

Full Screen

Full Screen

get-background-color.js

Source:get-background-color.js Github

copy

Full Screen

...49 bgElms.push(bgElm);50 const blendMode = bgElmStyle.getPropertyValue('mix-blend-mode');51 bgColors.unshift({52 color: bgColor,53 blendMode: normalizeBlendMode(blendMode)54 });55 // Exit if the background is opaque56 return bgColor.alpha === 1;57 } else {58 return false;59 }60 });61 if (bgColors === null || elmStack === null) {62 return null;63 }64 const pageBgs = getPageBackgroundColors(65 elm,66 elmStack.includes(document.body)67 );68 bgColors.unshift(...pageBgs);69 // default to white if bgColors is empty70 if (bgColors.length === 0) {71 return new Color(255, 255, 255, 1);72 }73 // Mix the colors together. Colors must be mixed in bottom up74 // order (background to foreground order) to produce the correct75 // result.76 // @see https://github.com/dequelabs/axe-core/issues/292477 const blendedColor = bgColors.reduce((bgColor, fgColor) => {78 return flattenColors(79 fgColor.color,80 bgColor.color instanceof Color ? bgColor.color : bgColor,81 fgColor.blendMode82 );83 });84 // default page background is white which must be mixed last85 // @see https://www.w3.org/TR/compositing-1/#pagebackdrop86 return flattenColors(87 blendedColor.color instanceof Color ? blendedColor.color : blendedColor,88 new Color(255, 255, 255, 1)89 );90}91/**92 * Determine if element is partially overlapped, triggering a Can't Tell result93 * @private94 * @param {Element} elm95 * @param {Element} bgElm96 * @param {Object} bgColor97 * @return {Boolean}98 */99function elmPartiallyObscured(elm, bgElm, bgColor) {100 var obscured =101 elm !== bgElm && !visuallyContains(elm, bgElm) && bgColor.alpha !== 0;102 if (obscured) {103 incompleteData.set('bgColor', 'elmPartiallyObscured');104 }105 return obscured;106}107function normalizeBlendMode(blendmode) {108 return !!blendmode ? blendmode : undefined;109}110/**111 * Get the page background color.112 * @private113 * @param {Element} elm114 * @param {Boolean} stackContainsBody115 * @return {Colors[]}116 */117function getPageBackgroundColors(elm, stackContainsBody) {118 const pageColors = [];119 // Body can sometimes appear out of order in the stack:120 // 1) Body is not the first element due to negative z-index elements121 // 2) Elements are positioned outside of body's rect coordinates122 // (see https://github.com/dequelabs/axe-core/issues/1456)123 // In those instances we need to determine if we should use the124 // body background or the html background color125 if (!stackContainsBody) {126 // if the html element defines a bgColor and body defines a127 // bgColor but body's height is not the full viewport, then the128 // html bgColor fills the full viewport and body bgColor only129 // fills to its size. however, if the html element does not130 // define a bgColor, then the body bgColor fills the full131 // viewport. so if the body wasn't added to the elmStack, we132 // need to know which bgColor to get (html or body)133 const html = document.documentElement;134 const body = document.body;135 const htmlStyle = window.getComputedStyle(html);136 const bodyStyle = window.getComputedStyle(body);137 const htmlBgColor = getOwnBackgroundColor(htmlStyle);138 const bodyBgColor = getOwnBackgroundColor(bodyStyle);139 const bodyBgColorApplies =140 bodyBgColor.alpha !== 0 && visuallyContains(elm, body);141 if (142 (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0) ||143 (bodyBgColorApplies && bodyBgColor.alpha !== 1)144 ) {145 pageColors.unshift({146 color: bodyBgColor,147 blendMode: normalizeBlendMode(148 bodyStyle.getPropertyValue('mix-blend-mode')149 )150 });151 }152 if (153 htmlBgColor.alpha !== 0 &&154 (!bodyBgColorApplies || (bodyBgColorApplies && bodyBgColor.alpha !== 1))155 ) {156 pageColors.unshift({157 color: htmlBgColor,158 blendMode: normalizeBlendMode(159 htmlStyle.getPropertyValue('mix-blend-mode')160 )161 });162 }163 }164 return pageColors;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var blendMode = 'overlay';3var normalizedBlendMode = wptools.normalizeBlendMode(blendMode);4console.log(normalizedBlendMode);5### normalizeBlendMode(blendMode)6MIT © [Chris Mather](

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var blendMode = wptoolkit.normalizeBlendMode("normal");3console.log('blendMode: ' + blendMode);4var wptoolkit = require('wptoolkit');5var blendMode = wptoolkit.normalizeBlendMode("normal");6console.log('blendMode: ' + blendMode);7var wptoolkit = require('wptoolkit');8var blendMode = wptoolkit.normalizeBlendMode("normal");9console.log('blendMode: ' + blendMode);10var wptoolkit = require('wptoolkit');11var blendMode = wptoolkit.normalizeBlendMode("normal");12console.log('blendMode: ' + blendMode);13var wptoolkit = require('wptoolkit');14var blendMode = wptoolkit.normalizeBlendMode("normal");15console.log('blendMode: ' + blendMode);16var wptoolkit = require('wptoolkit');17var blendMode = wptoolkit.normalizeBlendMode("normal");18console.log('blendMode: ' + blendMode);19var wptoolkit = require('wptoolkit');20var blendMode = wptoolkit.normalizeBlendMode("normal");21console.log('blendMode: ' + blendMode);22var wptoolkit = require('wptoolkit');23var blendMode = wptoolkit.normalizeBlendMode("normal");24console.log('blendMode: ' + blendMode);25var wptoolkit = require('wptoolkit');26var blendMode = wptoolkit.normalizeBlendMode("normal");27console.log('blendMode

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var blendMode = wptools.normalizeBlendMode('screen');3console.log(blendMode);4var wptools = require('wptools');5var blendMode = wptools.normalizeBlendMode('screen');6console.log(blendMode);7var wptools = require('wptools');8var blendMode = wptools.normalizeBlendMode('screen');9console.log(blendMode);10var wptools = require('wptools');11var blendMode = wptools.normalizeBlendMode('screen');12console.log(blendMode);13var wptools = require('wptools');14var blendMode = wptools.normalizeBlendMode('screen');15console.log(blendMode);16var wptools = require('wptools');17var blendMode = wptools.normalizeBlendMode('screen');18console.log(blendMode);19var wptools = require('wptools');20var blendMode = wptools.normalizeBlendMode('screen');21console.log(blendMode);22var wptools = require('w

Full Screen

Using AI Code Generation

copy

Full Screen

1var toolkit = require('wptoolkit');2toolkit.normalizeBlendMode('multiply');3### normalizeColor(color) ###4var toolkit = require('wptoolkit');5toolkit.normalizeColor('#e6e6e6');6### normalizeColorString(colorString) ###7var toolkit = require('wptoolkit');8toolkit.normalizeColorString('rgb(255, 255, 255)');9### normalizeColorValue(colorValue) ###10var toolkit = require('wptoolkit');11toolkit.normalizeColorValue(255);12### normalizeDashArray(dashArray) ###13var toolkit = require('wptoolkit');14toolkit.normalizeDashArray(5);15### normalizeFont(font) ###16var toolkit = require('wptoolkit');17toolkit.normalizeFont('bold 12px/30px Arial, sans-serif');18### normalizeGradient(gradient) ###19var toolkit = require('wptoolkit');20toolkit.normalizeGradient('linear-gradient(90deg, #e6e6e6 0%, #ffffff 100%)');21### normalizeImage(image) ###22var toolkit = require('wptoolkit');23### normalizeLineCap(lineCap) ###

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful