From d2aae4752a2718e2099779ef256babc47abf2fb1 Mon Sep 17 00:00:00 2001 From: Daishiky <77997662+Daishiky@users.noreply.github.com> Date: Sun, 19 Sep 2021 18:51:02 +0200 Subject: [PATCH] added embed_background color --- discord/colour.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/discord/colour.py b/discord/colour.py index 031dad6f..949c8bad 100644 --- a/discord/colour.py +++ b/discord/colour.py @@ -5562,5 +5562,23 @@ class Colour: def crayon_piggy_pink(cls): """A factory method that returns a :class:`Colour` with a value of ``0xFDDDE6``.""" return cls(0xFDDDE6) + + @classmethod + def embed_background(theme: str = "dark", cls: Type[CT]) -> CT: + """A factory method that returns a :class:`Color` with a value of + ``0x2F3136`` (dark) + ``0xf2f3f5`` (light). + + .. versionadded:: 2.0 + """ + themes_cls = { + "dark": 0x2F3136, + "light": 0xf2f3f5 + } + + if theme not in themes_cls: + raise TypeError("Theme must be one of \"dark\" and \"light\".") + + return cls(themes_cls[theme]) -Color = Colour \ No newline at end of file +Color = Colour