summaryrefslogtreecommitdiff
path: root/gerber/render/theme.py
diff options
context:
space:
mode:
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']),