decord/source/7882_extractOpacity.js
2026-08-12 06:57:52 +00:00

25 lines
541 B
JavaScript

// Module ID: 7882
// Function ID: 7883
// Name: extractOpacity
// Dependencies: []
// Module 7882 (extractOpacity)
arg5.default = function extractOpacity(str) {
if (typeof str === "string") {
const trimmed = str.trim();
if (trimmed.endsWith("%")) {
let result = +str.slice(0, -1) / 100;
}
const _isNaN = isNaN;
let num5 = 1;
if (!isNaN(result)) {
num5 = 1;
if (1 >= result) {
const _Math = Math;
num5 = Math.max(result, 0);
}
}
return num5;
}
result = +str;
};