diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-07-17 10:42:03 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-07-17 10:42:03 +0800 |
commit | 0dded38353e1d650458f6401aea37a4aadaf28ff (patch) | |
tree | a297c26c7cbb6b1c7d7a9cbe4eb4639b203fba53 /examples/cairo_example.py | |
parent | d0e9018da0d7c51c2195f641c9189f85378df3e8 (diff) | |
parent | d1598b46c91ee36719460d49d7ba2ed5ecd0ef45 (diff) | |
download | gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.gz gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.bz2 gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.zip |
Merge in negative soldermask. Still required further changes to support negatives for shapes that dont exist in the merge source
Diffstat (limited to 'examples/cairo_example.py')
-rw-r--r-- | examples/cairo_example.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/examples/cairo_example.py b/examples/cairo_example.py index a312e89..f2f6723 100644 --- a/examples/cairo_example.py +++ b/examples/cairo_example.py @@ -25,7 +25,7 @@ a .png file. import os from gerber import read -from gerber.render import GerberCairoContext +from gerber.render import GerberCairoContext, theme GERBER_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), 'gerbers')) @@ -40,25 +40,30 @@ drill = read(os.path.join(GERBER_FOLDER, 'ncdrill.DRD')) # Create a new drawing context ctx = GerberCairoContext() +# Set opacity and color for copper layer +ctx.alpha = 1.0 +ctx.color = theme.COLORS['hasl copper'] + # Draw the copper layer copper.render(ctx) # Set opacity and color for soldermask layer -ctx.alpha = 0.6 -ctx.color = (0.2, 0.2, 0.75) +ctx.alpha = 0.75 +ctx.color = theme.COLORS['green soldermask'] # Draw the soldermask layer -mask.render(ctx) +mask.render(ctx, invert=True) # Set opacity and color for silkscreen layer -ctx.alpha = 0.85 -ctx.color = (1, 1, 1) +ctx.alpha = 1.0 +ctx.color = theme.COLORS['white'] # Draw the silkscreen layer silk.render(ctx) # Set opacity for drill layer -ctx.alpha = 1. +ctx.alpha = 1.0 +ctx.color = theme.COLORS['black'] drill.render(ctx) # Write output to png file |