update image colours
[pinmux.git] / src / spec / ifaceprint.py
index 4a4104f41ded15c4acef89733e56dc6e62ec9909..04a79012f474c7a65259573fed17be4be6e089be 100644 (file)
@@ -2,7 +2,6 @@
 
 from copy import deepcopy
 from collections import OrderedDict
-import svgwrite
 from math import pi
 
 
@@ -10,6 +9,12 @@ def create_sv(fname, pins):
     """unsophisticated drawer of an SVG
     """
 
+    try:
+        import svgwrite
+    except ImportError:
+        print ("WARNING, no SVG image, not producing image %s" % fname)
+        return
+
     scale = 15
     width = len(pins['pads.north']) * scale
     height = len(pins['pads.east']) * scale
@@ -20,10 +25,10 @@ def create_sv(fname, pins):
                            size=(width+scale*40, height+scale*40))
     dwg.add(dwg.rect((woffs-scale*2, hoffs-scale*2),
                         (woffs+width-scale*12, hoffs+height-scale*12),
-            stroke=svgwrite.rgb(255, 255, 16, '%'),
+            stroke=svgwrite.rgb(16, 255, 16, '%'),
             stroke_width=scale/10.0))
 
-    dwg.add(dwg.text("Libre-SOC ls180",
+    dwg.add(dwg.text("Libre-SOC ls180 QFP-128",
                        insert=(woffs+width/2-scale*5, woffs+height/2),
                      fill='white'))
     dwg.add(dwg.text("In collaboration with LIP6.fr",
@@ -37,10 +42,10 @@ def create_sv(fname, pins):
         ht = hoffs + height - (i * scale) + scale*0.5
         dwg.add(dwg.line((woffs-scale*2, ht-scale*0.5),
                          (woffs-scale*4.5, ht-scale*0.5),
-                         stroke=svgwrite.rgb(255, 255, 16, '%'),
+                         stroke=svgwrite.rgb(16, 255, 16, '%'),
                          stroke_width=scale/10.0))
-        dwg.add(dwg.text(pin.upper(), insert=(woffs-scale*12, ht),
-                         fill='white'))
+        dwg.add(dwg.text(pin.upper(), insert=(woffs-scale*14, ht),
+                         fill='black'))
         dwg.add(dwg.text("W%d" % (i+1), insert=(woffs-scale*1.5, ht),
                             fill='white'))
 
@@ -49,10 +54,10 @@ def create_sv(fname, pins):
         wd = width + woffs + scale*2
         dwg.add(dwg.line((wd+scale*2, ht-scale*0.5),
                          (wd+scale*4.5, ht-scale*0.5),
-                         stroke=svgwrite.rgb(255, 255, 16, '%'),
+                         stroke=svgwrite.rgb(16, 255, 16, '%'),
                          stroke_width=scale/10.0))
         dwg.add(dwg.text(pin.upper(), insert=(wd+scale*5, ht-scale*0.25),
-                         fill='white'))
+                         fill='black'))
         dwg.add(dwg.text("E%d" % (i+1), insert=(wd, ht-scale*0.25),
                             fill='white'))
 
@@ -60,10 +65,10 @@ def create_sv(fname, pins):
         wd = woffs + i * scale + scale*1.5
         dwg.add(dwg.line((wd, hoffs-scale*2),
                          (wd, hoffs-scale*4.5),
-                         stroke=svgwrite.rgb(255, 255, 16, '%'),
+                         stroke=svgwrite.rgb(16, 255, 16, '%'),
                          stroke_width=scale/10.0))
         pos=(wd, hoffs-scale*5.0)
-        txt = dwg.text(pin.upper(), insert=pos, fill='white')
+        txt = dwg.text(pin.upper(), insert=pos, fill='black')
         txt.rotate(-90, pos)
         dwg.add(txt)
         pos=(wd+scale*0.25, hoffs-scale*0.25)
@@ -76,10 +81,10 @@ def create_sv(fname, pins):
         ht = hoffs + height + scale*2
         dwg.add(dwg.line((wd, ht+scale*2),
                          (wd, ht+scale*4.5),
-                         stroke=svgwrite.rgb(255, 255, 16, '%'),
+                         stroke=svgwrite.rgb(16, 255, 16, '%'),
                          stroke_width=scale/10.0))
         pos=(wd-scale*0.25, ht+scale*5.0)
-        txt = dwg.text(pin.upper(), insert=pos, fill='white')
+        txt = dwg.text(pin.upper(), insert=pos, fill='black')
         txt.rotate(90, pos)
         dwg.add(txt)
         pos=(wd-scale*0.25, ht+scale*0.25)