From a93d118773818fbd47af4965d7b37e1b10bdf9b6 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 22 Apr 2023 17:16:20 +0200 Subject: kicad unit tests WIP --- gerbonara/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gerbonara/utils.py') diff --git a/gerbonara/utils.py b/gerbonara/utils.py index e33a7bf..933b3ca 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -292,6 +292,10 @@ class Tag: own implementation by passing a ``tag`` parameter. """ def __init__(self, name, children=None, root=False, **attrs): + if (fill := attrs.get('fill')) and isinstance(fill, tuple): + attrs['fill'], attrs['fill-opacity'] = fill + if (stroke := attrs.get('stroke')) and isinstance(stroke, tuple): + attrs['stroke'], attrs['stroke-opacity'] = stroke self.name, self.attrs = name, attrs self.children = children or [] self.root = root -- cgit