Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parseInt(hex8.slice(6, 8), 16),
Math.round(parseInt(hex8.slice(8, 10), 16) / 255 * alphaDecimalPrecision) / alphaDecimalPrecision
];
// return a new rgba function, preserving the whitespace of the original node
const rgbaFunc = valueParser.func({ value: 'rgba', raws: Object.assign({}, node.raws) });
rgbaFunc.append(valueParser.paren({ value: '(' }));
rgbaFunc.append(valueParser.number({ value: r }));
rgbaFunc.append(valueParser.comma({ value: ',' }));
rgbaFunc.append(valueParser.number({ value: g }));
rgbaFunc.append(valueParser.comma({ value: ',' }));
rgbaFunc.append(valueParser.number({ value: b }));
rgbaFunc.append(valueParser.comma({ value: ',' }));
rgbaFunc.append(valueParser.number({ value: a }));
rgbaFunc.append(valueParser.paren({ value: ')' }));
return rgbaFunc;
};