ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
^c           @   sF   d  Z  d d l Td d l Z d d d     YZ d d	 d     YZ d S(
   sd  Chip viewer and widget.

In the lower left corner of the main Pynche window, you will see two
ChipWidgets, one for the selected color and one for the nearest color.  The
selected color is the actual RGB value expressed as an X11 #COLOR name. The
nearest color is the named color from the X11 database that is closest to the
selected color in 3D space.  There may be other colors equally close, but the
nearest one is the first one found.

Clicking on the nearest color chip selects that named color.

The ChipViewer class includes the entire lower left quandrant; i.e. both the
selected and nearest ChipWidgets.
i(   t   *Nt
   ChipWidgetc           B   sh   e  Z d  Z d Z d e e d d d d d  Z d   Z d   Z d   Z d   Z	 d	   Z
 d
   Z RS(   i   iP   t   Colort   bluec         C   sx  t  | d | |  _ |  j j d d d d  t | d t d d d | d	 | d
 | |  _ |  j j d d d d  t   |  _ |  j j |  t	 | d |  j d t
 d t d t d |  j d |  _ |  j j d d d d  t   |  _ t	 | d |  j d t
 d t d t d |  j d |  _ |  j j d d d d  | rX|  j j d |  n  | rt|  j j d |  n  d  S(   Nt   textt   rowi    t   columnt   relieft   borderwidthi   t   widtht   heightt
   backgroundi   t   textvariablet   justifyt   statet   fonti   s   <ButtonPress-1>s   <ButtonRelease-1>(   t   Labelt   _ChipWidget__labelt   gridt   Framet   RAISEDt   _ChipWidget__chipt	   StringVart   _ChipWidget__namevart   sett   Entryt   FLATt   CENTERt   DISABLEDt   _ChipWidget__namet   _ChipWidget__msgvart   bind(   t   selft   masterR	   R
   R   t   initialcolort   presscmdt
   releasecmd(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   __init__   s,    	c         C   s   |  j  j d |  d  S(   NR   (   R   t   config(   R    t   color(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt	   set_color<   s    c         C   s   |  j  d S(   NR   (   R   (   R    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt	   get_color?   s    c         C   s   |  j  j |  d  S(   N(   R   R   (   R    t	   colorname(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   set_nameB   s    c         C   s   |  j  j |  d  S(   N(   R   R   (   R    t   message(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   set_messageE   s    c         C   s   |  j  j d t  d  S(   NR   (   R   t	   configuret   SUNKEN(   R    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   pressH   s    c         C   s   |  j  j d t  d  S(   NR   (   R   R.   R   (   R    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   releaseK   s    N(   t   __name__t
   __module__t   _WIDTHt   _HEIGHTt   NoneR%   R(   R)   R+   R-   R0   R1   (    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyR      s   					t
   ChipViewerc           B   s5   e  Z d d   Z d   Z d d  Z d d  Z RS(   c      	   C   s   | |  _  t | d t d d |  _ |  j j d d d d d d	 d
 d  t |  j  |  _ |  j j d d d d  t |  j d d |  _ t |  j  |  _ |  j j d d d d  t |  j d d d |  j	 d |  j
 |  _ d  S(   NR   R   i   R   i   R   i    t   ipadxi   t   stickyt   NSEWR   t   Selectedt   NearestR#   R$   (   t   _ChipViewer__sbR   R   t   _ChipViewer__frameR   t   _ChipViewer__sframeR   t   _ChipViewer__selectedt   _ChipViewer__nframet   _ChipViewer__buttonpresst   _ChipViewer__buttonreleaset   _ChipViewer__nearest(   R    t   switchboardR!   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyR%   Q   s    	%	c   
      C   s   |  j  j   } | | | f } t j |  } | j | | |  } | j |  } t j |  }	 |  j j |  |  j j |	  |  j j	 |  | |	 k r |  j j
 |  n |  j j
 d  |  j j	 |	  |  j j
 |  d  S(   Nt    (   R=   t   colordbt   ColorDBt   triplet_to_rrggbbt   nearestt   find_bynameR@   R(   RD   R+   R-   (
   R    t   redt   greenR   RG   t   rgbtuplet   rrggbbRJ   t   nearest_tuplet   nearest_rrggbb(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   update_yourselfb   s    c         C   s   |  j  j   d  S(   N(   RD   R0   (   R    t   event(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   __buttonpress{   s    c         C   sN   |  j  j   |  j  j   } t j |  \ } } } |  j j | | |  d  S(   N(   RD   R1   R)   RH   t   rrggbb_to_tripletR=   t   update_views(   R    RS   RO   RL   RM   R   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   __buttonrelease~   s    N(   R2   R3   R6   R%   RR   RB   RC   (    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyR7   P   s   	(    (    (   t   __doc__t   TkinterRH   R   R7   (    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ChipViewer.pyt   <module>   s   
<