
[c           @   sQ   d  d l  m Z d e f d     YZ d d  Z e d k rM d Ge   GHn  d S(   i(   t   Dialogt   Chooserc           B   s&   e  Z d  Z d Z d   Z d   Z RS(   s   Ask for a colort   tk_chooseColorc         C   sL   y4 |  j  d } t | t  r3 d | |  j  d <n  Wn t k
 rG n Xd  S(   Nt   initialcolors   #%02x%02x%02x(   t   optionst
   isinstancet   tuplet   KeyError(   t   selft   color(    (    s+   /usr/lib/python2.7/lib-tk/tkColorChooser.pyt   _fixoptions!   s    c         C   sU   | s t  |  r d S| j |  \ } } } | d | d | d f t  |  f S(   Ni   (   NN(   t   strt   Nonet	   winfo_rgb(   R   t   widgett   resultt   rt   gt   b(    (    s+   /usr/lib/python2.7/lib-tk/tkColorChooser.pyt
   _fixresult+   s    (   t   __name__t
   __module__t   __doc__t   commandR
   R   (    (    (    s+   /usr/lib/python2.7/lib-tk/tkColorChooser.pyR      s   	
c         K   s/   |  r | j    } |  | d <n  t |   j   S(   s   Ask for a colorR   (   t   copyR   t   show(   R	   R   (    (    s+   /usr/lib/python2.7/lib-tk/tkColorChooser.pyt   askcolor:   s    t   __main__R	   N(   t   tkCommonDialogR    R   R   R   R   (    (    (    s+   /usr/lib/python2.7/lib-tk/tkColorChooser.pyt   <module>   s   