Skip to content

Commit

Permalink
Deploy latest build
Browse files Browse the repository at this point in the history
  • Loading branch information
egon-development committed Jul 31, 2024
1 parent 278bbd4 commit 73976cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions app-latest-build/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,17 +1105,14 @@ function DomainStoryRenderer(eventBus, styles, canvas, textRenderer, pathMap, co
}
const [rest, base64Svg] = iconSvg.split("base64,");
const svg = atob(base64Svg);
const coloredSvg = applyColorToIcon(pickedColor, svg, 0);
const coloredSvg = applyColorToIcon(pickedColor, svg);
const encodedColoredSvg = btoa(coloredSvg);
return rest + "base64," + encodedColoredSvg;
}
function applyColorToIcon(pickedColor, iconSvg, matchLength = 1) {
if (!pickedColor) {
pickedColor = DEFAULT_COLOR;
}
const match = iconSvg.match(/fill=".*?"/);
if (match && match.length > matchLength) {
return iconSvg.replaceAll(/fill=".*?"/g, 'fill="' + pickedColor + '"');
function applyColorToIcon(pickedColor = DEFAULT_COLOR, iconSvg) {
const match = iconSvg.match(/fill="(?!none).*?"/);
if (match && match.length > 0) {
return iconSvg.replaceAll(/fill="(?!none).*?"/g, 'fill="' + pickedColor + '"');
} else {
const index = iconSvg.indexOf("<svg ") + 5;
return iconSvg.substring(0, index) + ' fill=" ' + pickedColor + '" ' + iconSvg.substring(index);
Expand Down
2 changes: 1 addition & 1 deletion app-latest-build/main.js.map

Large diffs are not rendered by default.

0 comments on commit 73976cb

Please sign in to comment.