summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-12 12:38:40 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-12 12:38:40 -0400
commit8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb (patch)
treea9032538e4a96f11a9ec16d1c761f4d8862529a8 /gerber/render/render.py
parentd9018da412470053a063b7b28b5e32529fc573f6 (diff)
downloadgerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.tar.gz
gerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.tar.bz2
gerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.zip
update docs and example images
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r--gerber/render/render.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py
index 48a53f8..f7e4485 100644
--- a/gerber/render/render.py
+++ b/gerber/render/render.py
@@ -83,6 +83,9 @@ class GerberContext(object):
background_color : tuple (<float>, <float>, <float>)
Color of the background. Used when exposing areas in 'clear' level
polarity mode. Format is the same as for `color`.
+
+ alpha : float
+ Rendering opacity. Between 0.0 (transparent) and 1.0 (opaque.)
"""
def __init__(self):
self.settings = {}
@@ -100,7 +103,8 @@ class GerberContext(object):
self.color = (0.7215, 0.451, 0.200)
self.drill_color = (0.25, 0.25, 0.25)
self.background_color = (0.0, 0.0, 0.0)
-
+ self.alpha = 1.0
+
def set_format(self, settings):
""" Set source file format.
@@ -260,6 +264,19 @@ class GerberContext(object):
"""
self.background_color = color
+ def set_alpha(self, alpha):
+ """ Set layer rendering opacity
+
+ .. note::
+ Not all backends/rendering devices support this parameter.
+
+ Parameters
+ ----------
+ alpha : float
+ Rendering opacity. must be between 0.0 (transparent) and 1.0 (opaque)
+ """
+ self.alpha = alpha
+
def resolve(self, x, y):
""" Resolve missing x or y coordinates in a coordinate command.