summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-02-13 21:27:56 (GMT)
committerBarry Warsaw <barry@python.org>1998-02-13 21:27:56 (GMT)
commit2662e15f5895062f03c2759c1b7c87b22b63182a (patch)
tree092307fa8ed957d294ec04ea670bfc0e42f0320e /Tools
parent315b5d8a7f5adfb94b64f7a38963c352ff14ab76 (diff)
downloadcpython-2662e15f5895062f03c2759c1b7c87b22b63182a.zip
cpython-2662e15f5895062f03c2759c1b7c87b22b63182a.tar.gz
cpython-2662e15f5895062f03c2759c1b7c87b22b63182a.tar.bz2
triplet_to_pmwrgb(): New function
Diffstat (limited to 'Tools')
-rw-r--r--Tools/pynche/ColorDB.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tools/pynche/ColorDB.py b/Tools/pynche/ColorDB.py
index 33dfe02..f9ba27e 100644
--- a/Tools/pynche/ColorDB.py
+++ b/Tools/pynche/ColorDB.py
@@ -164,6 +164,11 @@ def triplet_to_rrggbb(rgbtuple):
return '#%s%s%s' % tuple(map(hexify, rgbtuple))
+def triplet_to_pmwrgb(rgbtuple, MAX=256.0):
+ r, g, b = rgbtuple
+ return r/MAX, g/MAX, b/MAX
+
+
if __name__ == '__main__':
import string