summaryrefslogtreecommitdiff
path: root/gerber/render/theme.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2016-01-01 12:25:38 -0500
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2016-01-01 12:25:38 -0500
commit6a005436b475e3517fd6a583473b60e601bcc661 (patch)
tree5678cff7ba877e9c93ea63445f081fd0430f8b4b /gerber/render/theme.py
parent5430fa6738b74f324c47c947477dd5b779db5d1c (diff)
downloadgerbonara-6a005436b475e3517fd6a583473b60e601bcc661.tar.gz
gerbonara-6a005436b475e3517fd6a583473b60e601bcc661.tar.bz2
gerbonara-6a005436b475e3517fd6a583473b60e601bcc661.zip
Refactor a little
pulled all rendering stuff out of the pcb/layer objects
Diffstat (limited to 'gerber/render/theme.py')
-rw-r--r--gerber/render/theme.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/gerber/render/theme.py b/gerber/render/theme.py
index 5978831..e538df8 100644
--- a/gerber/render/theme.py
+++ b/gerber/render/theme.py
@@ -16,6 +16,8 @@
# limitations under the License.
+from .render import RenderSettings
+
COLORS = {
'black': (0.0, 0.0, 0.0),
'white': (1.0, 1.0, 1.0),
@@ -33,14 +35,6 @@ COLORS = {
}
-class RenderSettings(object):
- def __init__(self, color, alpha=1.0, invert=False, mirror=False):
- self.color = color
- self.alpha = alpha
- self.invert = invert
- self.mirror = mirror
-
-
class Theme(object):
def __init__(self, name=None, **kwargs):
self.name = 'Default' if name is None else name
@@ -57,8 +51,13 @@ class Theme(object):
def __getitem__(self, key):
return getattr(self, key)
+ def get(self, key, noneval=None):
+ val = getattr(self, key)
+ return val if val is not None else noneval
+
+
THEMES = {
- 'Default': Theme(),
+ 'default': Theme(),
'OSH Park': Theme(name='OSH Park',
top=RenderSettings(COLORS['enig copper']),
bottom=RenderSettings(COLORS['enig copper']),