Update resolvedicon.jsx - upper case color hex codes
Update regular expression to also allow for upper case letters as part of the hex color code, as either are valid when describing an objects color.
This commit is contained in:
parent
185a4cbae5
commit
b7ea220118
@ -41,7 +41,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
|
|||||||
let iconColor;
|
let iconColor;
|
||||||
const suffix = icon.split("-")[icon.split("-").length - 1];
|
const suffix = icon.split("-")[icon.split("-").length - 1];
|
||||||
|
|
||||||
if (!(suffix.match(`[#][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]`) == null)) {
|
if (!(suffix.match(`[#][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]`) == null)) {
|
||||||
// set custom color code
|
// set custom color code
|
||||||
iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");
|
iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");
|
||||||
iconColor = `${suffix}`;
|
iconColor = `${suffix}`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user