§
    Ó! h°   ã                  ó  — d dl mZ d dlmZmZ d dlZd dlmZmZ d dl	Z	d dl
Zd dlZ
d dlZd dlmZ d dlmZ d dlmZ d dlmc mZ erd dlmZ 	 	 	 d.d/d„Zd0d„Zd1d„Zd2d„Zd3d„Zd4d „Z d5d"„Z!d6d$„Z"d5d%„Z#d7d&„Z$d8d'„Z%d8d(„Z&d9d+„Z'd:d-„Z(dS );é    )Úannotations)Ú
CollectionÚIteratorN)ÚTYPE_CHECKINGÚcast)ÚMatplotlibColor)Úfind_stack_level)Úis_list_like)ÚColormapÚdefaultÚ
num_colorsÚintÚcolormapúColormap | NoneÚ
color_typeÚstrÚcolorú3dict[str, Color] | Color | Collection[Color] | Nonec                ó’   — t          |t          ¦  «        r|S t          |||| ¬¦  «        }t          t	          || ¬¦  «        ¦  «        S )a§  
    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.
    ©r   r   r   r   ©r   )Ú
isinstanceÚdictÚ_derive_colorsÚlistÚ_cycle_colors)r   r   r   r   Úcolorss        ú[c:\xampp_lite_8_4\www\timesheet\venv\Lib\site-packages\pandas/plotting/_matplotlib/style.pyÚget_standard_colorsr      sY   € õL �%�ÑÔð ØˆåØØØØð	ñ ô €Fõ •˜f°Ð<Ñ<Ô<Ñ=Ô=Ð=ó    ú Color | Collection[Color] | Noneústr | Colormap | NoneÚreturnúlist[Color]c                ó¸   — | €|�t          ||¬¦  «        S | �3|�"t          j        dt          ¦   «         ¬¦  «         t	          | ¦  «        S t          ||¬¦  «        S )aa  
    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.
    Nr   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   sv   € ðN €}˜Ð-Ý(¨¸jÐIÑIÔIÐIØ	Ð	ØÐÝŒMØUÝ+Ñ-Ô-ðñ ô ð õ & eÑ,Ô,Ð,å*¨:À*ÐMÑMÔMÐMr    r   úIterator[Color]c              #  óž   K  — t          |t          | ¦  «        ¦  «        }t          j        t          j        | ¦  «        |¦  «        E d{V —† dS )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   „   sR   è è € õ �Z¥ V¡¤Ñ-Ô-€JÝÔ¥	¤°Ñ 7Ô 7¸ÑDÔDÐDÐDÐDÐDÐDÐDÐDÐDÐDr    ústr | Colormapc                óh   ‡— t          | ¦  «        Šˆfd„t          j        dd|¬¦  «        D ¦   «         S )zGet colors from colormap.c                ó&   •— g | ]} ‰|¦  «        ‘ŒS © r7   )Ú.0ÚnumÚcmaps     €r   ú
<listcomp>z-_get_colors_from_colormap.<locals>.<listcomp>”   s!   ø€ ÐCÐCÐC˜#ˆDˆD�‰IŒIÐCÐCÐCr    r   é   )r9   )Ú_get_cmap_instanceÚnpÚlinspace)r   r   r:   s     @r   r'   r'   Ž   s=   ø€ õ
 ˜hÑ'Ô'€DØCÐCÐCÐC¥¤¨Q°°zÐ!BÑ!BÔ!BÐCÑCÔCÐCr    r   c                ó‚   — t          | t          ¦  «        r)| }t          j        |          } | €t	          d|› d�¦  «        ‚| S )z$Get instance of matplotlib colormap.Nz	Colormap z is not recognized)r   r   ÚmplÚ	colormapsÚ
ValueError)r   r:   s     r   r=   r=   —   sK   € å�(�CÑ Ô ð CØˆÝ”= Ô*ˆØÐÝÐA¨ÐAÐAÐAÑBÔBÐBØ€Or    úColor | Collection[Color]c                ó  — t          | ¦  «        dk    rt          d| › �¦  «        ‚t          | ¦  «        rt          t          | ¦  «        } | gS t          t
          t                   | ¦  «        } t          t          | ¦  «        ¦  «        S )z!Get colors from user input color.r   zInvalid color argument: )r/   rC   Ú_is_single_colorr   ÚColorr   r   Ú!_gen_list_of_colors_from_iterable©r   s    r   r*   r*   ¡   s{   € õ ˆ5�z„z�Q‚€ÝÐ;°EÐ;Ð;Ñ<Ô<Ð<å˜ÑÔð Ý•U˜EÑ"Ô"ˆØˆwˆå•�EÔ" EÑ*Ô*€EÝÕ1°%Ñ8Ô8Ñ9Ô9Ð9r    Úboolc                ót   — t          | t          ¦  «        rt          | ¦  «        rdS t          | ¦  «        rdS dS )a0  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   r   Ú_is_single_string_colorÚ_is_floats_colorrI   s    r   rF   rF   °   sE   € õ �%�ÑÔð Õ"9¸%Ñ"@Ô"@ð àˆtå˜ÑÔð Øˆtàˆ5r    úCollection[Color]c              #  ó^   K  — | D ]'}t          |¦  «        r|V — Œt          d|› �¦  «        ‚dS )zS
    Yield colors from string of several letters or from collection of colors.
    zInvalid color N)rF   rC   )r   Úxs     r   rH   rH   Æ   sS   è è € ð ð 3ð 3ˆÝ˜AÑÔð 	3ØˆGˆGˆGˆGåÐ1¨aÐ1Ð1Ñ2Ô2Ð2ð	3ð 3r    c                ó¸   — t          t          | ¦  «        o>t          | ¦  «        dk    pt          | ¦  «        dk    ot          d„ | D ¦   «         ¦  «        ¦  «        S )zACheck if color comprises a sequence of floats representing color.é   é   c              3  óN   K  — | ] }t          |t          t          f¦  «        V — Œ!d S )N)r   r   Úfloat)r8   rP   s     r   ú	<genexpr>z#_is_floats_color.<locals>.<genexpr>Ö   s0   è è € Ð;Ð;°•
˜1�s¥E˜lÑ+Ô+Ð;Ð;Ð;Ð;Ð;Ð;r    )rJ   r
   r/   ÚallrI   s    r   rM   rM   Ñ   s_   € åÝ�UÑÔð 	<Ý�‰ZŒZ˜1Š_Ð/¥ E¡
¤
¨a¢ð	<åÐ;Ð;°UÐ;Ñ;Ô;Ñ;Ô;ñô ð r    c                ót   — | dk    rt          |¦  «        S | dk    rt          |¦  «        S t          d¦  «        ‚)z&Get colors from user input color type.r   Úrandomz/color_type must be either 'default' or 'random')Ú_get_default_colorsÚ_get_random_colorsrC   )r   r   s     r   r+   r+   Ú   sC   € à�YÒÐÝ" :Ñ.Ô.Ð.Ø	�xÒ	Ð	Ý! *Ñ-Ô-Ð-åÐJÑKÔKÐKr    c                óP   — ddl m} d„ |j        d         D ¦   «         }|d| …         S )z=Get `num_colors` of default colors from matplotlib rc params.r   Nc                ó   — g | ]
}|d          ‘ŒS rI   r7   )r8   Úcs     r   r;   z'_get_default_colors.<locals>.<listcomp>è   s   € ÐBÐBÐB˜Qˆa�ŒjÐBÐBÐBr    zaxes.prop_cycle)Úmatplotlib.pyplotÚpyplotÚrcParams)r   Úpltr   s      r   rZ   rZ   ä   s>   € à#Ð#Ð#Ð#Ð#Ð#àBÐB #¤,Ð/@Ô"AÐBÑBÔB€FØ�!�J�,ÔÐr    c                ó4   — d„ t          | ¦  «        D ¦   «         S )z"Get `num_colors` of random colors.c                ó,   — g | ]}t          |¦  «        ‘ŒS r7   )Ú_random_color)r8   r9   s     r   r;   z&_get_random_colors.<locals>.<listcomp>î   s    € Ð<Ð<Ð< 3�M˜#ÑÔÐ<Ð<Ð<r    )Úranger   s    r   r[   r[   ì   s   € à<Ð<­%°
Ñ*;Ô*;Ð<Ñ<Ô<Ð<r    Úcolumnúlist[float]c                óx   — t          j        | ¦  «        }|                     d¦  «                             ¦   «         S )z4Get a random color represented as a list of length 3rR   )ÚcomÚrandom_stateÚrandÚtolist)rg   Úrss     r   re   re   ñ   s0   € õ 
Ô	˜&Ñ	!Ô	!€BØ�7Š7�1‰:Œ:×ÒÑÔÐr    rG   c                ó�   — t           j                             ¦   «         }	 |                     | ¦  «         dS # t          $ r Y dS w xY w)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_rgbarC   )r   Úconvs     r   rL   rL   ø   s\   € õ, Ô×+Ò+Ñ-Ô-€Dðð 	�Š�UÑÔÐð ˆtøõ ð ð ð Øˆuˆuðøøøs    7 ·
AÁA)Nr   N)r   r   r   r   r   r   r   r   )
r   r!   r   r"   r   r   r   r   r#   r$   )r   r$   r   r   r#   r,   )r   r4   r   r   r#   r$   )r   r4   r#   r   )r   rD   r#   r$   )r   rD   r#   rJ   )r   rN   r#   r,   )r   r   r   r   r#   r$   )r   r   r#   r$   )rg   r   r#   rh   )r   rG   r#   rJ   ))Ú
__future__r   Úcollections.abcr   r   r0   Útypingr   r   r(   rp   rA   Úmatplotlib.colorsÚnumpyr>   Úpandas._typingr   rG   Úpandas.util._exceptionsr	   Úpandas.core.dtypes.commonr
   Úpandas.core.commonÚcoreÚcommonrj   r   r   r   r   r'   r=   r*   rF   rH   rM   r+   rZ   r[   re   rL   r7   r    r   ú<module>r      sS  ðØ "Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð Ð Ð Ð ðð ð ð ð ð ð ð ð €€€à Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4à 2Ð 2Ð 2Ð 2Ð 2Ð 2à  Ð  Ð  Ð  Ð  Ð  Ð  Ð  Ð  àð +Ø*Ð*Ð*Ð*Ð*Ð*ð
 !%ØØAEð	0>ð 0>ð 0>ð 0>ð 0>ðf1Nð 1Nð 1Nð 1NðhEð Eð Eð EðDð Dð Dð Dðð ð ð ð:ð :ð :ð :ðð ð ð ð,3ð 3ð 3ð 3ðð ð ð ðLð Lð Lð Lð ð  ð  ð  ð=ð =ð =ð =ð
ð ð ð ðð ð ð ð ð r    