From: Marius Gedminas <marius@gedmin.as>
... | ... |
@@ -26,6 +26,7 @@ __version__ = "0.3" |
26 | 26 |
import sys |
27 | 27 |
import subprocess |
28 | 28 |
import math |
29 |
+import colorsys |
|
29 | 30 |
|
30 | 31 |
import gobject |
31 | 32 |
import gtk |
... | ... |
@@ -410,8 +411,10 @@ class XDotAttrParser: |
410 | 411 |
a = 1.0 |
411 | 412 |
return r, g, b, a |
412 | 413 |
elif c1.isdigit(): |
413 |
- h, s, v = map(float, c[1:].split(",")) |
|
414 |
- raise NotImplementedError |
|
414 |
+ h, s, v = map(float, c.split(",")) |
|
415 |
+ r, g, b = colorsys.hsv_to_rgb(h, s, v) |
|
416 |
+ a = 1.0 |
|
417 |
+ return r, g, b, a |
|
415 | 418 |
else: |
416 | 419 |
color = gtk.gdk.color_parse(c) |
417 | 420 |
s = 1.0/65535.0 |