From 2662e15f5895062f03c2759c1b7c87b22b63182a Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 13 Feb 1998 21:27:56 +0000 Subject: [PATCH] triplet_to_pmwrgb(): New function --- Tools/pynche/ColorDB.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/pynche/ColorDB.py b/Tools/pynche/ColorDB.py index 33dfe0238c5..f9ba27edec0 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