
    l0j              	       l    d dl Z dddddddd	d
ZdedededefdZ e j        d          ZdedefdZdS )    Nz[30mz[31mz[32mz[33mz[34mz[35mz[36mz[37m)blackredgreenyellowbluemagentacyanwhitetext	fg_colourboldreturnc                     	 t           |         }nI# t          $ r<}t          dt          t                                                                |d}~ww xY w| |  d}|rd|z   }|S )zuFormats `text` with a foreground colour `fg_colour`, and optionally mark it
    `bold`, using ANSI colour codes.
    z)Colour not recognised. Valid colours are Nz[0mz[1m)_colour_codesKeyError
ValueErrortuplekeys)r   r   r   colour_codeeouts         V/home/wildlama/miniconda3/envs/lam/lib/python3.11/site-packages/wadler_lindig/_ansi.pyansi_formatr      s    #I.   Um>P>P>R>R8S8SUU
 
	 
'$
'
'
'C #oJs    
A7AAz\x1b\[[;?0-9]*[a-zA-Z]c                 8    t                               d|           S )z%Removes all ANSI codes from a string. )_ansi_regexsub)r   s    r   
ansi_stripr   #   s    ??2t$$$    )rer   strboolr   compiler   r    r   r   <module>r%      s    				 	 	c c  #      bj233%S %S % % % % % %r   