summaryrefslogtreecommitdiff
path: root/lib/param/color.py
diff options
context:
space:
mode:
authorPepper <pepper@scannerjammer.com>2015-10-05 16:38:23 -0400
committerPepper <pepper@scannerjammer.com>2015-10-05 16:38:23 -0400
commit7265621a3ccf6a45e25d67804dfce0f075a6cdb0 (patch)
tree036653c5195fe18205cb0e23f21f2d5df6f526e8 /lib/param/color.py
parent1d438583118aeb523a63c8e7425e480a08148473 (diff)
fixed bug in color.py
Diffstat (limited to 'lib/param/color.py')
-rw-r--r--lib/param/color.py11
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"