@bbl-digital/snorre 4.2.39 → 4.2.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +7 -2
- package/esm/utils/alpha.js +7 -2
- package/lib/utils/alpha.d.ts.map +1 -1
- package/lib/utils/alpha.js +7 -2
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -6349,8 +6349,13 @@
|
|
6349
6349
|
});
|
6350
6350
|
alpha$1.alpha = alpha;
|
6351
6351
|
function alpha(hexColor, alphaPercentage) {
|
6352
|
-
|
6353
|
-
|
6352
|
+
// Ensure alphaPercentage is between 0 and 100
|
6353
|
+
const normalizedPercentage = Math.max(0, Math.min(100, alphaPercentage));
|
6354
|
+
// Convert percentage to hex (0-255)
|
6355
|
+
const opacity = Math.round(normalizedPercentage * 2.55);
|
6356
|
+
// Convert to hex and ensure 2 characters
|
6357
|
+
const hexOpacity = opacity.toString(16).padStart(2, '0');
|
6358
|
+
return hexColor + hexOpacity.toUpperCase();
|
6354
6359
|
}
|
6355
6360
|
|
6356
6361
|
Object.defineProperty(styles$1i, "__esModule", {
|
package/esm/utils/alpha.js
CHANGED
@@ -5,6 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.alpha = alpha;
|
7
7
|
function alpha(hexColor, alphaPercentage) {
|
8
|
-
|
9
|
-
|
8
|
+
// Ensure alphaPercentage is between 0 and 100
|
9
|
+
const normalizedPercentage = Math.max(0, Math.min(100, alphaPercentage));
|
10
|
+
// Convert percentage to hex (0-255)
|
11
|
+
const opacity = Math.round(normalizedPercentage * 2.55);
|
12
|
+
// Convert to hex and ensure 2 characters
|
13
|
+
const hexOpacity = opacity.toString(16).padStart(2, '0');
|
14
|
+
return hexColor + hexOpacity.toUpperCase();
|
10
15
|
}
|
package/lib/utils/alpha.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"alpha.d.ts","sourceRoot":"","sources":["../../src/packages/utils/alpha.ts"],"names":[],"mappings":"AAAA,iBAAS,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"alpha.d.ts","sourceRoot":"","sources":["../../src/packages/utils/alpha.ts"],"names":[],"mappings":"AAAA,iBAAS,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAQvD;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/lib/utils/alpha.js
CHANGED
@@ -5,6 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.alpha = alpha;
|
7
7
|
function alpha(hexColor, alphaPercentage) {
|
8
|
-
|
9
|
-
|
8
|
+
// Ensure alphaPercentage is between 0 and 100
|
9
|
+
const normalizedPercentage = Math.max(0, Math.min(100, alphaPercentage));
|
10
|
+
// Convert percentage to hex (0-255)
|
11
|
+
const opacity = Math.round(normalizedPercentage * 2.55);
|
12
|
+
// Convert to hex and ensure 2 characters
|
13
|
+
const hexOpacity = opacity.toString(16).padStart(2, '0');
|
14
|
+
return hexColor + hexOpacity.toUpperCase();
|
10
15
|
}
|