File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,31 @@ def nitro_pink(cls: Type[CT]) -> CT:
333
333
.. versionadded:: 2.0
334
334
"""
335
335
return cls (0xf47fff )
336
+
337
+ @classmethod
338
+ def embed_background (cls : Type [CT ], theme : str = "dark" ) -> CT :
339
+ """A factory method that returns a :class:`Color` corresponding to the embed colors on discord clients, with a value of
340
+ ``0x2F3136`` (dark)
341
+ ``0xf2f3f5`` (light)
342
+ ``0x000000`` (amoled).
343
+
344
+ .. versionadded:: 2.0
345
+
346
+ Parameters
347
+ -----------
348
+ theme: :class:`str`
349
+ The theme color to apply, must be one of "dark", "light", or "amoled".
350
+ """
351
+ themes_cls = {
352
+ "dark" : 0x2F3136 ,
353
+ "light" : 0xf2f3f5 ,
354
+ "amoled" : 0x000000 ,
355
+ }
356
+
357
+ if theme not in themes_cls :
358
+ raise TypeError ("Theme must be \" dark\" , \" light\" , or \" amoled\" ." )
359
+
360
+ return cls (themes_cls [theme ])
336
361
337
362
338
363
Color = Colour
You can’t perform that action at this time.
0 commit comments