Browse Source

Add colours for new Discord themes

pull/10152/head
Leonardo Cavenago 2 weeks ago
parent
commit
8852d7ad5e
Failed to extract signature
  1. 81
      discord/colour.py

81
discord/colour.py

@ -21,6 +21,7 @@ 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 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
""" """
from __future__ import annotations from __future__ import annotations
import colorsys import colorsys
@ -457,20 +458,59 @@ class Colour:
""" """
return cls(0x99AAB5) return cls(0x99AAB5)
@classmethod
def ash_theme(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x2E2E34``.
This will appear transparent on Discord's ash theme.
.. colour:: #2E2E34
.. versionadded:: 2.6
"""
return cls(0x2E2E34)
@classmethod @classmethod
def dark_theme(cls) -> Self: def dark_theme(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x313338``. """A factory method that returns a :class:`Colour` with a value of ``0x313338``.
This will appear transparent on Discord's dark theme. This will appear transparent on Discord's dark theme.
.. colour:: #313338 .. colour:: #1A1A1E
.. versionadded:: 1.5 .. versionadded:: 1.5
.. versionchanged:: 2.2 .. versionchanged:: 2.2
Updated colour from previous ``0x36393F`` to reflect discord theme changes. Updated colour from previous ``0x36393F`` to reflect discord theme changes.
.. versionchanged:: 2.6
Updated colour from previous ``0x313338`` to reflect discord theme changes.
""" """
return cls(0x313338) return cls(0x1A1A1E)
@classmethod
def onyx_theme(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x070709``.
This will appear transparent on Discord's onyx theme.
.. colour:: #070709
.. versionadded:: 2.6
"""
return cls(0x070709)
@classmethod
def light_theme(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0xFBFBFB``.
This will appear transparent on Discord's light theme.
.. colour:: #FBFBFB
.. versionadded:: 2.6
"""
return cls(0xFBFBFB)
@classmethod @classmethod
def fuchsia(cls) -> Self: def fuchsia(cls) -> Self:
@ -492,25 +532,52 @@ class Colour:
""" """
return cls(0xFEE75C) return cls(0xFEE75C)
@classmethod
def ash_embed(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x37373E``.
.. colour:: #37373E
.. versionadded:: 2.6
"""
return cls(0x37373E)
@classmethod @classmethod
def dark_embed(cls) -> Self: def dark_embed(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x2B2D31``. """A factory method that returns a :class:`Colour` with a value of ``0x242429``.
.. colour:: #2B2D31 .. colour:: #242429
.. versionadded:: 2.2 .. versionadded:: 2.2
.. versionchanged:: 2.6
Updated colour from previous ``0x2B2D31`` to reflect discord theme changes.
"""
return cls(0x242429)
@classmethod
def onyx_embed(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0x131416``.
.. colour:: #131416
.. versionadded:: 2.6
""" """
return cls(0x2B2D31) return cls(0x131416)
@classmethod @classmethod
def light_embed(cls) -> Self: def light_embed(cls) -> Self:
"""A factory method that returns a :class:`Colour` with a value of ``0xEEEFF1``. """A factory method that returns a :class:`Colour` with a value of ``0xFFFFFF``.
.. colour:: #EEEFF1 .. colour:: #EEEFF1
.. versionadded:: 2.2 .. versionadded:: 2.2
.. versionchanged:: 2.6
Updated colour from previous ``0xEEEFF1`` to reflect discord theme changes.
""" """
return cls(0xEEEFF1) return cls(0xFFFFFF)
@classmethod @classmethod
def pink(cls) -> Self: def pink(cls) -> Self:

Loading…
Cancel
Save