diff --git a/build/Dockerfile.txt b/build/Dockerfile similarity index 100% rename from build/Dockerfile.txt rename to build/Dockerfile diff --git a/build/VERSION b/build/VERSION index 56fea8a0..a0cd9f0c 100755 --- a/build/VERSION +++ b/build/VERSION @@ -1 +1 @@ -3.0.0 \ No newline at end of file +3.1.0 \ No newline at end of file diff --git a/build/main.go b/build/main.go index d47b8f5b..e0d59e3d 100755 --- a/build/main.go +++ b/build/main.go @@ -169,16 +169,27 @@ func fetchRemoteFile(url string) (string, error) { func applySVGColor(svgContent, colorCode string) string { color := "#" + colorCode - + + // Replace fill:#fff re1 := regexp.MustCompile(`style="[^"]*fill:\s*#fff[^"]*"`) svgContent = re1.ReplaceAllStringFunc(svgContent, func(match string) string { re2 := regexp.MustCompile(`fill:\s*#fff`) return re2.ReplaceAllString(match, "fill:"+color) }) - + re3 := regexp.MustCompile(`fill="#fff"`) svgContent = re3.ReplaceAllString(svgContent, `fill="`+color+`"`) - + + // Replace stop-color:#fff in gradients + re4 := regexp.MustCompile(`style="[^"]*stop-color:\s*#fff[^"]*"`) + svgContent = re4.ReplaceAllStringFunc(svgContent, func(match string) string { + re5 := regexp.MustCompile(`stop-color:\s*#fff`) + return re5.ReplaceAllString(match, "stop-color:"+color) + }) + + re6 := regexp.MustCompile(`stop-color="#fff"`) + svgContent = re6.ReplaceAllString(svgContent, `stop-color="`+color+`"`) + return svgContent }