
    cjhK+                    d    d Z ddlmZ ddlZddlZddlmZmZ dZ edd      Z	 G d	 d      Z
e
Zy)
ae  
The MIT License (MIT)

Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotationsN)AnyTypeVar)ColourColorCTr   )boundc                     e Zd ZdZdZd2dZd3dZd4dZd5dZd6dZ	d5dZ
d6d	Zed6d
       Zed6d       Zed6d       Zd7dZed8d       Zed9d       Zed:d       Zedd	 	 	 	 	 d;d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Zed:d       Z ed:d       Z!ed:d        Z"ed:d!       Z#ed:d"       Z$ed:d#       Z%ed:d$       Z&ed:d%       Z'ed:d&       Z(e(Z)ed:d'       Z*e*Z+ed:d(       Z,e,Z-ed:d)       Z.e.Z/ed:d*       Z0ed:d+       Z1ed:d,       Z2ed:d-       Z3ed:d.       Z4ed:d/       Z5ed:d0       Z6ed<d=d1       Z7y)>r   a  Represents a Discord role colour. This class is similar
    to a (red, green, blue) :class:`tuple`.

    There is an alias for this called Color.

    .. container:: operations

        .. describe:: x == y

             Checks if two colours are equal.

        .. describe:: x != y

             Checks if two colours are not equal.

        .. describe:: hash(x)

             Return the colour's hash.

        .. describe:: str(x)

             Returns the hex format for the colour.

        .. describe:: int(x)

             Returns the raw colour value.

    Attributes
    ----------
    value: :class:`int`
        The raw integer colour value.
    valuec                x    t        |t              s#t        d|j                  j                   d      || _        y )Nz!Expected int parameter, received z	 instead.)
isinstanceint	TypeError	__class____name__r   )selfr   s     A/var/www/html/venv/lib/python3.12/site-packages/discord/colour.py__init__zColour.__init__L   s9    %%3EOO4L4L3MYW   
    c                ,    | j                   d|z  z	  dz  S )N      r   )r   bytes     r   	_get_bytezColour._get_byteT   s    

q4x(D00r   c                X    t        |t              xr | j                  |j                  k(  S N)r   r   r   )r   others     r   __eq__zColour.__eq__W   s!    %(FTZZ5;;-FFr   c                "    d| j                   dS )N#z0>6xr   r   s    r   __str__zColour.__str__Z   s    4::d#$$r   c                    | j                   S r   r   r"   s    r   __int__zColour.__int__]   s    zzr   c                "    d| j                    dS )Nz<Colour value=>r   r"   s    r   __repr__zColour.__repr__`   s    

|1--r   c                ,    t        | j                        S r   )hashr   r"   s    r   __hash__zColour.__hash__c   s    DJJr   c                $    | j                  d      S )z(Returns the red component of the colour.   r   r"   s    r   rzColour.rf        ~~a  r   c                $    | j                  d      S )z*Returns the green component of the colour.   r.   r"   s    r   gzColour.gk   r0   r   c                $    | j                  d      S )z)Returns the blue component of the colour.r   r.   r"   s    r   bzColour.bp   r0   r   c                H    | j                   | j                  | j                  fS )z3Returns an (r, g, b) tuple representing the colour.)r/   r3   r5   r"   s    r   to_rgbzColour.to_rgbu   s    vvtvvtvv%%r   c                *     | |dz  |dz  z   |z         S )z/Constructs a :class:`Colour` from an RGB tuple.   r    )clsr/   r3   r5   s       r   from_rgbzColour.from_rgby   s!     AGQ'!+,,r   c                \    t        j                  |||      } | j                  d |D         S )z/Constructs a :class:`Colour` from an HSV tuple.c              3  8   K   | ]  }t        |d z          yw)r   N)r   ).0xs     r   	<genexpr>z"Colour.from_hsv.<locals>.<genexpr>   s     8qc!c'l8s   )colorsys
hsv_to_rgbr<   )r;   hsvrgbs        r   from_hsvzColour.from_hsv~   s/     !!!Q*s||8C899r   c                     | d      S )zFA factory method that returns a :class:`Colour` with a value of ``0``.r   r:   r;   s    r   defaultzColour.default   s     1vr   N)seedc               ~    |t         nt        j                  |      }| j                  |j                         dd      S )a  A factory method that returns a :class:`Colour` with a random hue.

        .. note::

            The random algorithm works by choosing a colour with a random hue but
            with maxed out saturation and value.

        .. versionadded:: 1.6

        Parameters
        ----------
        seed: Optional[Union[:class:`int`, :class:`str`, :class:`float`, :class:`bytes`, :class:`bytearray`]]
            The seed to initialize the RNG with. If ``None`` is passed the default RNG is used.

            .. versionadded:: 1.7
        r2   )randomRandomrH   )r;   rL   rands      r   rN   zColour.random   s1    , v6==+>||DKKM1a00r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x1abc9c``.i r:   rJ   s    r   tealzColour.teal        8}r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x11806a``.ij r:   rJ   s    r   	dark_tealzColour.dark_teal   rS   r   c                     | d      S )zuA factory method that returns a :class:`Colour` with a value of ``0x57F287``.

        .. versionadded:: 2.0
        iW r:   rJ   s    r   brand_greenzColour.brand_green        8}r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x2ecc71``.iq. r:   rJ   s    r   greenzColour.green   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x1f8b4c``.iL r:   rJ   s    r   
dark_greenzColour.dark_green   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x3498db``.iۘ4 r:   rJ   s    r   bluezColour.blue   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x206694``.if  r:   rJ   s    r   	dark_bluezColour.dark_blue   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x9b59b6``.iY r:   rJ   s    r   purplezColour.purple   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x71368a``.i6q r:   rJ   s    r   dark_purplezColour.dark_purple   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xe91e63``.ic r:   rJ   s    r   magentazColour.magenta   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xad1457``.iW r:   rJ   s    r   dark_magentazColour.dark_magenta   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xf1c40f``.i r:   rJ   s    r   goldzColour.gold   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xc27c0e``.i| r:   rJ   s    r   	dark_goldzColour.dark_gold   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xe67e22``.i"~ r:   rJ   s    r   orangezColour.orange   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xa84300``.i C r:   rJ   s    r   dark_orangezColour.dark_orange   rS   r   c                     | d      S )zuA factory method that returns a :class:`Colour` with a value of ``0xED4245``.

        .. versionadded:: 2.0
        iEB r:   rJ   s    r   	brand_redzColour.brand_red   rX   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0xe74c3c``.i<L r:   rJ   s    r   redz
Colour.red   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x992d22``.i"- r:   rJ   s    r   dark_redzColour.dark_red   rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x95a5a6``.i r:   rJ   s    r   lighter_greyzColour.lighter_grey  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x607d8b``.i}` r:   rJ   s    r   	dark_greyzColour.dark_grey	  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x979c9f``.i r:   rJ   s    r   
light_greyzColour.light_grey  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x546e7a``.iznT r:   rJ   s    r   darker_greyzColour.darker_grey  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x7289da``.iډr r:   rJ   s    r   
og_blurplezColour.og_blurple  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x5865F2``.ieX r:   rJ   s    r   blurplezColour.blurple#  rS   r   c                     | d      S )zMA factory method that returns a :class:`Colour` with a value of ``0x99aab5``.i r:   rJ   s    r   greyplezColour.greyple(  rS   r   c                     | d      S )zA factory method that returns a :class:`Colour` with a value of ``0x36393F``.
        This will appear transparent on Discord's dark theme.

        .. versionadded:: 1.5
        i?96 r:   rJ   s    r   
dark_themezColour.dark_theme-  s     8}r   c                     | d      S )zuA factory method that returns a :class:`Colour` with a value of ``0xEB459E``.

        .. versionadded:: 2.0
        iE r:   rJ   s    r   fuchsiazColour.fuchsia6  rX   r   c                     | d      S )zuA factory method that returns a :class:`Colour` with a value of ``0xFEE75C``.

        .. versionadded:: 2.0
        i\ r:   rJ   s    r   yellowzColour.yellow>  rX   r   c                     | d      S )zuA factory method that returns a :class:`Colour` with a value of ``0xf47fff``.

        .. versionadded:: 2.0
        i r:   rJ   s    r   
nitro_pinkzColour.nitro_pinkF  rX   r   c                B    dddd}||vrt        d       | ||         S )a  A factory method that returns a :class:`Colour` corresponding to the
        embed colours on discord clients, with a value of:

        - ``0x2B2D31`` (dark)
        - ``0xEEEFF1`` (light)
        - ``0x000000`` (amoled).

        .. versionadded:: 2.0

        Parameters
        ----------
        theme: :class:`str`
            The theme colour to apply, must be one of "dark", "light", or "amoled".
        i1-+ i r   )darklightamoledz+Theme must be "dark", "light", or "amoled".)r   )r;   theme
themes_clss      r   embed_backgroundzColour.embed_backgroundN  s:    " 

 
"IJJ:e$%%r   )r   r   )r   r   returnr   )r   r   r   bool)r   str)r   r   )r   ztuple[int, int, int])
r;   type[CT]r/   r   r3   r   r5   r   r   r   )
r;   r   rD   floatrE   r   rF   r   r   r   )r;   r   r   r   )r;   r   rL   z,int | str | float | bytes | bytearray | Noner   r   )r   )r;   r   r   r   r   r   )8r   
__module____qualname____doc__	__slots__r   r   r   r#   r%   r(   r+   propertyr/   r3   r5   r7   classmethodr<   rH   rK   rN   rR   rU   rW   rZ   r\   r^   r`   rb   rd   rf   rh   rj   rl   rn   rp   rr   rt   rv   rx   lighter_grayrz   	dark_grayr|   
light_grayr~   darker_grayr   r   r   r   r   r   r   r   r:   r   r   r   r   (   sR   B I 1G%.  ! ! ! ! ! !& - - : :
    >B11 ;1 
	1 10                                        L  I  J  K              & &r   )r   
__future__r   rB   rN   typingr   r   __all__r   r   r   r:   r   r   <module>r      sA   2 #   
 T"& &D
 	r   