Specify fill="none" for transparency in SVG
authorArmaan Bhojwani <me@armaanb.net>
Sat, 9 Jan 2021 03:57:02 +0000 (22:57 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 9 Jan 2021 03:57:02 +0000 (22:57 -0500)
svg2img
template/circle.svg
template/square.svg

diff --git a/svg2img b/svg2img
index 9c1eba6ddd9d62f384c224088c345e8b31c4b045..e632960edf2d8a7facbe7f810f334bcb6afdced0 100755 (executable)
--- a/svg2img
+++ b/svg2img
@@ -11,39 +11,39 @@ if [[ (! -d "square/svg" || ! -d "circle/svg") || (${1} == "svg") ]]; then
     mkdir -pv ${SHAPE}/svg
 
     sed -e 's/STROKE/stroke="#00ffbf" /g' \
-      -e 's/FILL/ fill="#212121"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#212121/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-color-dark.svg
 
     sed -e 's/STROKE/stroke="#00ffbf" /g' \
-      -e 's/FILL/ fill="#fff"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#fff/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-color-white.svg
 
     sed -e 's/STROKE/stroke="#00ffbf" /g' \
-      -e 's/FILL//g' template/${SHAPE}.svg \
+      -e 's/FILL/none/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-color-trans.svg
 
     sed -e 's/STROKE/stroke="#212121" /g' \
-      -e 's/FILL/ fill="#00ffbf"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#00ffbf/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-dark-color.svg
 
     sed -e 's/STROKE/stroke="#212121" /g' \
-      -e 's/FILL/ fill="#fff"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#fff/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-dark-white.svg
 
     sed -e 's/STROKE/stroke="#212121" /g' \
-      -e 's/FILL//g' template/${SHAPE}.svg \
+      -e 's/FILL/none/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-dark-trans.svg
 
     sed -e 's/STROKE/stroke="#fff" /g' \
-      -e 's/FILL/ fill="#00ffbf"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#00ffbf/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-white-color.svg
 
     sed -e 's/STROKE/stroke="#fff" /g' \
-      -e 's/FILL/ fill="#212121"/g' template/${SHAPE}.svg \
+      -e 's/FILL/#212121/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-white-dark.svg
 
     sed -e 's/STROKE/stroke="#fff" /g' \
-      -e 's/FILL//g' template/${SHAPE}.svg \
+      -e 's/FILL/none/g' template/${SHAPE}.svg \
       > ${SHAPE}/svg/logo-${SHAPE}-white-trans.svg
   done
 fi
index 7eaab618f1fb1282290bbf2d16e3c9e92ece856e..5210884e324653a61cec44a6119664708b45d029 100644 (file)
@@ -1,6 +1,6 @@
 <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
  <g STROKEstroke-width="6">
-   <circle cx="50" cy="50" r="47"FILL/>
+   <circle cx="50" cy="50" r="47" fill="FILL"/>
    <line x1="17" y1="17" x2="50" y2="50"/>
    <line x1="17" y1="83" x2="83" y2="17"/>
    <line x1="50" y1="97" x2="88" y2="22"/>
index 2f254cb28ea3fff51e98e01e5a0600eded61e813..8241d93dffbb6c0f7648865fb60c1a9eee43fb7b 100644 (file)
@@ -1,6 +1,6 @@
 <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
  <g STROKEstroke-width="6">
-   <rect x="3" y="3" width="94" height="94"FILL/>
+   <rect x="3" y="3" width="94" height="94" fill="FILL"/>
    <line x1="3" y1="3" x2="50" y2="50"/>
    <line x1="97" y1="3" x2="3" y2="97"/>
    <line x1="50" y1="97" x2="97" y2="3"/>