ó
    ¬œ‘h°   ã                  ót  • S SK Jr  S SKJrJr  S SKrS SKJrJr  S SK	r	S SK
rS SKr
S SKrS SKJr  S SKJr  S SKJr  S SKJs  Jr  \(       a  S SKJr     S       SS	 jjr          SS
 jrSS jr      SS jrSS jr    SS jr SS jr!SS jr"SS jr#S S jr$S!S jr%S!S jr&S"S jr'S#S jr(g)$é    )Úannotations)Ú
CollectionÚIteratorN)ÚTYPE_CHECKINGÚcast)ÚMatplotlibColor)Úfind_stack_level)Úis_list_like)ÚColormapc                ól   • [        U[        5      (       a  U$ [        UUUU S9n[        [	        X@S95      $ )a7  
Get standard colors based on `colormap`, `color_type` or `color` inputs.

Parameters
----------
num_colors : int
    Minimum number of colors to be returned.
    Ignored if `color` is a dictionary.
colormap : :py:class:`matplotlib.colors.Colormap`, optional
    Matplotlib colormap.
    When provided, the resulting colors will be derived from the colormap.
color_type : {"default", "random"}, optional
    Type of colors to derive. Used if provided `color` and `colormap` are None.
    Ignored if either `color` or `colormap` are not None.
color : dict or str or sequence, optional
    Color(s) to be used for deriving sequence of colors.
    Can be either be a dictionary, or a single color (single color string,
    or sequence of floats representing a single color),
    or a sequence of colors.

Returns
-------
dict or list
    Standard colors. Can either be a mapping if `color` was a dictionary,
    or a list of colors with a length of `num_colors` or more.

Warns
-----
UserWarning
    If both `colormap` and `color` are provided.
    Parameter `color` will override.
©ÚcolorÚcolormapÚ
color_typeÚ
num_colors©r   )Ú
isinstanceÚdictÚ_derive_colorsÚlistÚ_cycle_colors)r   r   r   r   Úcolorss        ÚeC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\pandas/plotting/_matplotlib/style.pyÚget_standard_colorsr      s?   € ôL �%œ×ÑØˆäØØØØñ	€Fô ”˜fÑ<Ó=Ð=ó    c                óŽ   • U c  Ub	  [        XS9$ U b+  Ub  [        R                  " S[        5       S9  [	        U 5      $ [        X#S9$ )aõ  
Derive colors from either `colormap`, `color_type` or `color` inputs.

Get a list of colors either from `colormap`, or from `color`,
or from `color_type` (if both `colormap` and `color` are None).

Parameters
----------
color : str or sequence, optional
    Color(s) to be used for deriving sequence of colors.
    Can be either be a single color (single color string, or sequence of floats
    representing a single color), or a sequence of colors.
colormap : :py:class:`matplotlib.colors.Colormap`, optional
    Matplotlib colormap.
    When provided, the resulting colors will be derived from the colormap.
color_type : {"default", "random"}, optional
    Type of colors to derive. Used if provided `color` and `colormap` are None.
    Ignored if either `color` or `colormap`` are not None.
num_colors : int
    Number of colors to be extracted.

Returns
-------
list
    List of colors extracted.

Warns
-----
UserWarning
    If both `colormap` and `color` are provided.
    Parameter `color` will override.
r   zC'color' and 'colormap' cannot be used simultaneously. Using 'color')Ú
stacklevel)Ú_get_colors_from_colormapÚwarningsÚwarnr	   Ú_get_colors_from_colorÚ_get_colors_from_color_typer   s       r   r   r   P   sS   € ðN �}˜Ñ-Ü(¨ÑIÐIØ	Ñ	ØÑÜ�MŠMØUÜ+Ó-òô & eÓ,Ð,ä*¨:ÑMÐMr   c              #  ó    #   • [        U[        U 5      5      n[        R                  " [        R                  " U 5      U5       Sh  v•N   g N7f)z¼Cycle colors until achieving max of `num_colors` or length of `colors`.

Extra colors will be ignored by matplotlib if there are more colors
than needed and nothing needs to be done here.
N)ÚmaxÚlenÚ	itertoolsÚisliceÚcycle)r   r   Ú
max_colorss      r   r   r   „   s6   é € ô �Z¤ V£Ó-€JÜ×Ò¤	§¢°Ó 7¸ÓD×DÓDùs   ‚AAÁAÁAc                óz   • [        U 5      n[        R                  " SSUS9 Vs/ s H
  o2" U5      PM     sn$ s  snf )zGet colors from colormap.r   é   )Únum)Ú_get_cmap_instanceÚnpÚlinspace)r   r   Úcmapr,   s       r   r   r   Ž   s9   € ô
 ˜hÓ'€DÜ!#§¢¨Q°°zÒ!BÓCÒ!B˜#ˆD�ŽIÑ!BÑCÐCùÒCs   ¤8c                ó~   • [        U [        5      (       a'  U n[        R                  U    n U c  [	        SU S35      eU $ )z$Get instance of matplotlib colormap.z	Colormap z is not recognized)r   ÚstrÚmplÚ	colormapsÚ
ValueError)r   r0   s     r   r-   r-   —   sB   € ä�(œC× Ñ ØˆÜ—=‘= Ñ*ˆØÑÜ˜y¨¨Ð.@ÐAÓBÐBØ€Or   c                óØ   • [        U 5      S:X  a  [        SU  35      e[        U 5      (       a  [        [        U 5      n U /$ [        [
        [           U 5      n [        [        U 5      5      $ )z!Get colors from user input color.r   zInvalid color argument: )r%   r5   Ú_is_single_colorr   ÚColorr   r   Ú!_gen_list_of_colors_from_iterable©r   s    r   r!   r!   ¡   sb   € ô ˆ5ƒz�QƒÜÐ3°E°7Ð;Ó<Ð<ä˜×ÑÜ”U˜EÓ"ˆØˆwˆä”œEÑ" EÓ*€EÜÔ1°%Ó8Ó9Ð9r   c                ór   • [        U [        5      (       a  [        U 5      (       a  g[        U 5      (       a  gg)a  Check if `color` is a single color, not a sequence of colors.

Single color is of these kinds:
    - Named color "red", "C0", "firebrick"
    - Alias "g"
    - Sequence of floats, such as (0.1, 0.2, 0.3) or (0.1, 0.2, 0.3, 0.4).

See Also
--------
_is_single_string_color
TF)r   r2   Ú_is_single_string_colorÚ_is_floats_colorr:   s    r   r7   r7   °   s0   € ô �%œ×ÑÔ"9¸%×"@Ñ"@àä˜×ÑØàr   c              #  ób   #   • U  H%  n[        U5      (       a  Uv •  M  [        SU 35      e   g7f)zK
Yield colors from string of several letters or from collection of colors.
zInvalid color N)r7   r5   )r   Úxs     r   r9   r9   Æ   s3   é € ó ˆÜ˜A×ÑØŒGä˜~¨a¨SÐ1Ó2Ð2ò	 ùs   ‚-/c                ó°   • [        [        U 5      =(       a<    [        U 5      S:H  =(       d    [        U 5      S:H  =(       a    [        S U  5       5      5      $ )zACheck if color comprises a sequence of floats representing color.é   é   c              3  óN   #   • U  H  n[        U[        [        45      v •  M     g 7f)N)r   ÚintÚfloat)Ú.0r?   s     r   Ú	<genexpr>Ú#_is_floats_color.<locals>.<genexpr>Ö   s   é € Ð;²U°”
˜1œs¤E˜l×+Ð+²Uùs   ‚#%)Úboolr
   r%   Úallr:   s    r   r=   r=   Ñ   sG   € äÜ�UÓ÷ 	<Ü�‹Z˜1‰_×/¤ E£
¨a¡÷	<äÑ;±UÓ;Ó;óð r   c                ó\   • U S:X  a  [        U5      $ U S:X  a  [        U5      $ [        S5      e)z&Get colors from user input color type.ÚdefaultÚrandomz/color_type must be either 'default' or 'random')Ú_get_default_colorsÚ_get_random_colorsr5   )r   r   s     r   r"   r"   Ú   s4   € à�YÓÜ" :Ó.Ð.Ø	�xÓ	Ü! *Ó-Ð-äÐJÓKÐKr   c                ód   • SSK Jn  UR                  S    Vs/ s H  o"S   PM	     nnUSU  $ s  snf )z=Get `num_colors` of default colors from matplotlib rc params.r   Nzaxes.prop_cycler   )Úmatplotlib.pyplotÚpyplotÚrcParams)r   ÚpltÚcr   s       r   rN   rN   ä   s:   € å#à"%§,¡,Ð/@Ò"AÓBÒ"A˜Q�ŒjÑ"A€FÐBØ�!�JÐÐùò Cs   ˜-c                óV   • [        U 5       Vs/ s H  n[        U5      PM     sn$ s  snf )z"Get `num_colors` of random colors.)ÚrangeÚ_random_color)r   r,   s     r   rO   rO   ì   s&   € ä*/°
Ô*;Ó<Ò*; 3ŒM˜#ÖÑ*;Ñ<Ð<ùÒ<s   Ž&c                ól   • [         R                  " U 5      nUR                  S5      R                  5       $ )z4Get a random color represented as a list of length 3rA   )ÚcomÚrandom_stateÚrandÚtolist)ÚcolumnÚrss     r   rX   rX   ñ   s+   € ô 
×	Ò	˜&Ó	!€BØ�7‰7�1‹:×ÑÓÐr   c                ó„   • [         R                  R                  5       n UR                  U 5        g! [         a     gf = f)a?  Check if `color` is a single string color.

Examples of single string colors:
    - 'r'
    - 'g'
    - 'red'
    - 'green'
    - 'C3'
    - 'firebrick'

Parameters
----------
color : Color
    Color string or sequence of floats.

Returns
-------
bool
    True if `color` looks like a valid color.
    False otherwise.
TF)Ú
matplotlibr   ÚColorConverterÚto_rgbar5   )r   Úconvs     r   r<   r<   ø   sD   € ô, ×Ñ×+Ñ+Ó-€Dðð 	�‰�UÔð øô ó Ùðús    2 ²
?¾?)NrL   N)r   rD   r   zColormap | Noner   r2   r   z3dict[str, Color] | Color | Collection[Color] | None)
r   z Color | Collection[Color] | Noner   zstr | Colormap | Noner   r2   r   rD   Úreturnúlist[Color])r   rf   r   rD   re   úIterator[Color])r   ústr | Colormapr   rD   re   rf   )r   rh   re   r   )r   úColor | Collection[Color]re   rf   )r   ri   re   rI   )r   zCollection[Color]re   rg   )r   r2   r   rD   re   rf   )r   rD   re   rf   )r^   rD   re   zlist[float])r   r8   re   rI   ))Ú
__future__r   Úcollections.abcr   r   r&   Útypingr   r   r   ra   r3   Úmatplotlib.colorsÚnumpyr.   Úpandas._typingr   r8   Úpandas.util._exceptionsr	   Úpandas.core.dtypes.commonr
   Úpandas.core.commonÚcoreÚcommonrZ   r   r   r   r   r   r-   r!   r7   r9   r=   r"   rN   rO   rX   r<   © r   r   Ú<module>rv      s  ðÝ "÷ó ÷ó ã Û Û å 3Ý 4å 2ç  Ð  æÝ*ð
 !%ØØAEð	0>Øð0>àð0>ð ð0>ð ?õ	0>ðf1Nà+ð1Nð $ð1Nð ð	1Nð
 ð1Nð ô1NôhEðDØðDàðDð ôDôð:Ø$ð:àô:ôô,3ôôLô ô=ô
õr   