o
    OZŽhG  ã                   @   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   úI/var/www/auris/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rŽd| d< d}n‡|jt jkr¬| d  |7  < | d dkr©d| d< d}nl|jt jkrÇ| d  |7  < | d dkrÄd| d< d}nQ|jt jkrÓt j}d}nE|jt jkrßt j}d}n9|jt jkrët j}d}n-|jt j kr÷t 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ÚconvertZblitÚflipÚkeyZ
set_repeatr   ÚeventÚgetÚtypeZQUITZKEYDOWNZK_ESCAPEZK_rZK_gZK_bZK_aZ	BLEND_ADDZK_sZ	BLEND_SUBZK_mZ
BLEND_MULTZK_PLUSZ	BLEND_MAXZK_MINUSZ	BLEND_MINr   r   r   r   r   r   r   r	   r
   ÚintÚunicoder   ÚtupleZget_atÚquit)	ÚcolorÚchangedZ	blendtypeÚstepÚscreenr   Z
blendimageZgoingr'   r   r   r   Úmain   sŠ   



ÿ
€Å=r2   Ú__main__)Ú__doc__r    Zpygamer   r   r   r   r   r   r   r   r	   r
   r   r!   ÚsplitÚabspathÚ__file__Zmain_dirr"   r#   r2   Ú__name__r   r   r   r   Ú<module>   s   ,T
ÿ