decord/source/8415_extractOpacity.js

26 lines
541 B
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 8415
// Function ID: 8416
2026-07-20 16:05:17 +00:00
// Name: extractOpacity
// Dependencies: []
2026-08-05 07:35:12 +00:00
// Module 8415 (extractOpacity)
2026-07-20 16:05:17 +00:00
arg5.default = function extractOpacity(str) {
2026-08-04 21:03:28 +00:00
if (typeof str === "string") {
2026-07-20 16:05:17 +00:00
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;
2026-07-29 08:29:29 +00:00
if (1 >= result) {
2026-07-20 16:05:17 +00:00
const _Math = Math;
num5 = Math.max(result, 0);
}
}
return num5;
}
result = +str;
};