diff options
Diffstat (limited to 'lib/param/color.py')
| -rw-r--r-- | lib/param/color.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/param/color.py b/lib/param/color.py index 096a1e8..02d694d 100644 --- a/lib/param/color.py +++ b/lib/param/color.py @@ -9,11 +9,12 @@ class Color(Param): """ def __init__(self, value, classname=""): super(Color, self).__init__(classname=classname) - try: - self.value = self._color_sanitize(value) - except Exception as e: - self.err_warn("Unable to sanitize the color: %s" % str(value)) - self.err_warn(str(e)) + if value: + try: + self.value = self._color_sanitize(value) + except Exception as e: + self.err_warn("Unable to sanitize the color: %s" % str(value)) + self.err_warn(str(e)) def _color_sanitize(self, s): if s == "": return "transparent" |
