MCPcopy Create free account
hub / github.com/ampproject/amphtml / removeAlphaFromColor

Function removeAlphaFromColor

src/core/dom/style.js:287–292  ·  view source on GitHub ↗
(rgbaColor)

Source from the content-addressed store, hash-verified

285 * @return {string}
286 */
287export function removeAlphaFromColor(rgbaColor) {
288 return rgbaColor.replace(
289 /\(([^,]+),([^,]+),([^,)]+),[^)]+\)/g,
290 '($1,$2,$3, 1)'
291 );
292}
293
294/**
295 * Gets the computed style of the element. The helper is necessary to enforce

Callers 1

forceOpacity_Method · 0.90

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected