Browse code

Properly support HSV colors (floats can start with a '.').

From: Marius Gedminas <marius@gedmin.as>

Jose.R.Fonseca authored on 13/07/2008 03:15:36
Showing 1 changed files

  • xdot.py index 5a201c7..d383fdf 100755
... ...
@@ -410,7 +410,7 @@ class XDotAttrParser:
410 410
             except (IndexError, ValueError):
411 411
                 a = 1.0
412 412
             return r, g, b, a
413
-        elif c1.isdigit():
413
+        elif c1.isdigit() or c1 == ".":
414 414
             # "H,S,V" or "H S V" or "H, S, V" or any other variation
415 415
             h, s, v = map(float, c.replace(",", " ").split())
416 416
             r, g, b = colorsys.hsv_to_rgb(h, s, v)