o
    tVgG                     @   s   d Z ddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZ dd Zejejed ZejedZdd Zed	krDe  dS dS )
a   pygame.examples.blend_fill

BLEND_ing colors in different ways with Surface.fill().

Keyboard Controls:

* Press R, G, B to increase the color channel values,
* 1-9 to set the step range for the increment,
* A - ADD, S- SUB, M- MULT, - MIN, + MAX to change the blend modes

    N)	K_1K_2K_3K_4K_5K_6K_7K_8K_9c                   C   s$   t d t d t d t d d S )Nz3Press R, G, B to increase the color channel values,z,1-9 to set the step range for the increment,z&A - ADD, S- SUB, M- MULT, - MIN, + MAXz  to change the blend modes)print r   r   N/home/ubuntu/.local/lib/python3.10/site-packages/pygame/examples/blend_fill.pyusage   s   r   datac            	      C   s  g d} d}d}d}t   t jddd}|d t jtj	t
d }t jtj	t
d }||d	 ||d
 t j  t jdd t  d}|rSt j D ]}|jt jkrdd}|jt jkrt  |jt jkrvd}|jt jkr| d  |7  < | d dkrd| d< d}n|jt jkr| d  |7  < | d dkrd| d< d}nl|jt jkr| d  |7  < | d dkrd| d< d}nQ|jt jkrt j}d}nE|jt jkrt j}d}n9|jt jkrt j}d}n-|jt j krt j!}d}n!|jt j"krt j#}d}n|jt$t%t&t't(t)t*t+t,f	v rt-|j.}|rP|d ||d	 ||d || d | ||d
 t/dt0|  d|1dg  d}t j  qZ|sUt 2  d S )N)r   r   r   Fr      )i  i      )d   r   r   z
liquid.bmp)
   r   )   r   i     T         )r   r   zColor: z, Pixel (0,0): )3pginitdisplayset_modefillimageloadospathjoindata_dirconvertblitflipkey
set_repeatr   eventgettypeQUITKEYDOWNK_ESCAPEK_rK_gK_bK_a	BLEND_ADDK_s	BLEND_SUBK_m
BLEND_MULTK_PLUS	BLEND_MAXK_MINUS	BLEND_MINr   r   r   r   r   r   r   r	   r
   intunicoder   tupleget_atquit)	colorchanged	blendtypestepscreenr   
blendimagegoingr)   r   r   r   main   s   




=rH   __main__)__doc__r    pygamer   r   r   r   r   r   r   r   r	   r
   r   r!   splitabspath__file__main_dirr"   r#   rH   __name__r   r   r   r   <module>   s   ,T
