@rpg-engine/long-bow 0.8.12 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/long-bow.cjs.development.js +10 -1
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +10 -1
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/utils/colorUtils.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/shared/SpriteFromAtlas.tsx +4 -1
- package/src/utils/colorUtils.ts +11 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -585,6 +585,14 @@ var ButtonContainer = /*#__PURE__*/styled.button.withConfig({
|
|
|
585
585
|
componentId: "sc-obzd3o-0"
|
|
586
586
|
})(["height:45px;font-size:", ";"], uiFonts.size.small);
|
|
587
587
|
|
|
588
|
+
var toUppercaseHexColor = function toUppercaseHexColor(color) {
|
|
589
|
+
if (!color) return undefined;
|
|
590
|
+
// Check if it's a valid hex color
|
|
591
|
+
var hexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
592
|
+
if (!hexRegex.test(color)) return color;
|
|
593
|
+
return color.toUpperCase();
|
|
594
|
+
};
|
|
595
|
+
|
|
588
596
|
var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
589
597
|
var _atlasJSON$frames, _atlasJSON$frames2;
|
|
590
598
|
var atlasJSON = _ref.atlasJSON,
|
|
@@ -614,6 +622,7 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
|
614
622
|
console.error("SpriteFromAtlas: Could not find sprite with key " + spriteKey + " in atlasJSON.");
|
|
615
623
|
return null;
|
|
616
624
|
}
|
|
625
|
+
var normalizedTintColor = toUppercaseHexColor(tintColor);
|
|
617
626
|
return React.createElement(Container$1, {
|
|
618
627
|
width: width,
|
|
619
628
|
height: height,
|
|
@@ -630,7 +639,7 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
|
630
639
|
style: imgStyle,
|
|
631
640
|
centered: centered,
|
|
632
641
|
borderRadius: borderRadius,
|
|
633
|
-
tintColor:
|
|
642
|
+
tintColor: normalizedTintColor
|
|
634
643
|
}));
|
|
635
644
|
};
|
|
636
645
|
var Container$1 = /*#__PURE__*/styled.div.withConfig({
|