
    ed
                     v    d dl mZ ddgZ G d de          Zd	dZedk    r ed e                       dS dS )
    )DialogChooseraskcolorc                   "    e Zd ZdZdZd Zd ZdS )r   a  Create a dialog for the tk_chooseColor command.

    Args:
        master: The master widget for this dialog.  If not provided,
            defaults to options['parent'] (if defined).
        options: Dictionary of options for the tk_chooseColor call.
            initialcolor: Specifies the selected color when the
                dialog is first displayed.  This can be a tk color
                string or a 3-tuple of ints in the range (0, 255)
                for an RGB triplet.
            parent: The parent window of the color dialog.  The
                color dialog is displayed on top of this.
            title: A string for the title of the dialog box.
    tk_chooseColorc                     	 | j         d         }t          |t                    rd|z  | j         d<   dS dS # t          $ r Y dS w xY w)zvEnsure initialcolor is a tk color string.

        Convert initialcolor from a RGB triplet to a color string.
        initialcolorz#%02x%02x%02xN)options
isinstancetupleKeyError)selfcolors     &  /home/conda/feedstock_root/build_artifacts/python-split_1708115622739/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/tkinter/colorchooser.py_fixoptionszChooser._fixoptions#   sm    
	L0E%'' G/>/F^,,,G G  	 	 	DD	s   /5 
AAc                     |rt          |          sdS |                    |          \  }}}|dz  |dz  |dz  ft          |          fS )zAdjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
        )NN   )str	winfo_rgb)r   widgetresultrgbs         r   
_fixresultzChooser._fixresult0   s]      	S[[ 	: ""6**1a333'V44    N)__name__
__module____qualname____doc__commandr   r    r   r   r   r      sC          G  5 5 5 5 5r   Nc                 t    | r|                                 }| |d<   t          di |                                S )zDisplay dialog window for selection of a color.

    Convenience wrapper for the Chooser class.  Displays the color
    chooser dialog with color as the initial value.
    r	   r"   )copyr   show)r   r
   s     r   r   r   D   sC      (,,.."'W""$$$r   __main__r   )N)tkinter.commondialogr   __all__r   r   r   printr"   r   r   <module>r*      s    ( ' ' ' ' 'j
!-5 -5 -5 -5 -5f -5 -5 -5f% % % %" z	E'88:: r   