Browse code

Fix HSV color parsing to support space-separated values as well as comma-separated ones.

From: Marius Gedminas <marius@gedmin.as>

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

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