summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgradient.py4
-rwxr-xr-ximgrid.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/gradient.py b/gradient.py
index 247dc63..991f853 100755
--- a/gradient.py
+++ b/gradient.py
@@ -19,8 +19,10 @@ import sha
#}}}
def is_color(s):
+ if s == "":
+ return "transparent"
if re.match('(rgba?\([0-9]+,[0-9]+,[0-9]+\))|([a-zA-Z]+)|(\#[A-Ha-h0-9]+)', s):
- return s
+ return s.replace(' ','')
else:
raise ValueError
PARAM_LIST = [
diff --git a/imgrid.py b/imgrid.py
index d36c3d3..ece50b0 100755
--- a/imgrid.py
+++ b/imgrid.py
@@ -35,7 +35,7 @@ def is_color(s):
if s == "":
return "transparent"
if re.match('(rgba?\([0-9]+,[0-9]+,[0-9]+\))|([a-zA-Z]+)|(\#[A-Ha-h0-9]+)', s):
- return s
+ return s.replace(' ', '');
else:
sys.stderr.write("Not a color: {}\n".format(s))
raise ValueError