#
# written by Fredrik Lundh, May 1997
#
+# fixed initialcolor handling in August 1998
+#
#
# options (all have default values):
# - title: dialog title
#
-# FIXME: as of Tk 8.0a2, the Unix colour picker is really ugly, and
-# doesn't seem to work properly on true colour displays. maybe we
-# should use the instant python version instead?
-
from tkCommonDialog import Dialog
color = self.options["initialcolor"]
if type(color) == type(()):
# assume an RGB triplet
- self.options["initialcolor"] = "%02x%02x%02x" % color
+ self.options["initialcolor"] = "#%02x%02x%02x" % color
except KeyError:
pass
def askcolor(color = None, **options):
"Ask for a color"
+ if color:
+ options = options.copy()
+ options["initialcolor"] = color
+
return apply(Chooser, (), options).show()