diff options
author | jaseg <git@jaseg.de> | 2022-01-23 01:19:30 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-01-23 01:19:30 +0100 |
commit | deb2bb2bbfc13e6dce8adf493221a4fe4929a344 (patch) | |
tree | ef1356afa3036f231bc460dacf186d035646c443 /gerbonara/gerber/tests/image_support.py | |
parent | 07d279f89faefde4793ae2de4d3a629dc87da63e (diff) | |
download | gerbonara-deb2bb2bbfc13e6dce8adf493221a4fe4929a344.tar.gz gerbonara-deb2bb2bbfc13e6dce8adf493221a4fe4929a344.tar.bz2 gerbonara-deb2bb2bbfc13e6dce8adf493221a4fe4929a344.zip |
Squash some more bugs
Diffstat (limited to 'gerbonara/gerber/tests/image_support.py')
-rw-r--r-- | gerbonara/gerber/tests/image_support.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gerbonara/gerber/tests/image_support.py b/gerbonara/gerber/tests/image_support.py index 662dbed..c43f7b6 100644 --- a/gerbonara/gerber/tests/image_support.py +++ b/gerbonara/gerber/tests/image_support.py @@ -81,7 +81,9 @@ def gerbv_export(in_gbr, out_svg, export_format='svg', origin=(0, 0), size=(6, 6 else: unit_spec = '' - f.write(f'''(gerbv-file-version! "2.0A")(define-layer! 0 (cons 'filename "{in_gbr}"){unit_spec})''') + r, g, b = int(fg[1:3], 16), int(fg[3:5], 16), int(fg[5:], 16) + color = f"(cons 'color #({r*257} {g*257} {b*257}))" + f.write(f'''(gerbv-file-version! "2.0A")(define-layer! 0 (cons 'filename "{in_gbr}"){unit_spec}{color})''') f.flush() x, y = origin @@ -89,7 +91,6 @@ def gerbv_export(in_gbr, out_svg, export_format='svg', origin=(0, 0), size=(6, 6 cmd = ['gerbv', '-x', export_format, '--border=0', f'--origin={x:.6f}x{y:.6f}', f'--window_inch={w:.6f}x{h:.6f}', - f'--foreground={fg}', f'--background={bg}', '-o', str(out_svg), '-p', f.name] subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |