diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-07-20 23:37:18 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-07-20 23:37:18 +0800 |
commit | b0e13cc596a380b042a5db1f62a5c850b3573519 (patch) | |
tree | 2f25348808975986f33c572912ac893bbb64fbe2 /gerber/render/theme.py | |
parent | e8327fda79ede786e2fbc79eaf1b394f12fe66ce (diff) | |
parent | 6a005436b475e3517fd6a583473b60e601bcc661 (diff) | |
download | gerbonara-b0e13cc596a380b042a5db1f62a5c850b3573519.tar.gz gerbonara-b0e13cc596a380b042a5db1f62a5c850b3573519.tar.bz2 gerbonara-b0e13cc596a380b042a5db1f62a5c850b3573519.zip |
Merge in 6a005436b475e3517fd6a583473b60e601bcc661
Diffstat (limited to 'gerber/render/theme.py')
-rw-r--r-- | gerber/render/theme.py | 17 |
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']), |