Skip to content

Instantly share code, notes, and snippets.

@Soheab
Last active May 20, 2024 15:16
Show Gist options
  • Save Soheab/d9cf3f40e34037cfa544f464fc7d919e to your computer and use it in GitHub Desktop.
Save Soheab/d9cf3f40e34037cfa544f464fc7d919e to your computer and use it in GitHub Desktop.
See everything related to discord.Colour in a clean way with their usages.

discord.Colour

See here every colour and method the discord.Colour class has.

Jump Links

Colours

Attributes and Methods

                                                                                                                                               🔽 Go Down 🔽

Teal

.teal()

.dark_teal()

Green

.green()

.dark_green()

.brand_green()

New in version 2.0.

Blue

.blurple()

.og_blurple()

New in version 2.0.

.blue()

.dark_blue()

Purple

.purple()

.dark_purple()

Magenta

.magenta()

.dark_magenta()

Gold

.gold()

.dark_gold()

Orange

.orange()

.dark_orange()

Red

.red()

.dark_red()

.brand_red()

New in version 2.0.

Grey

.greyple()

.light_grey()

.lighter_grey()

.dark_grey()

.darker_grey()

Embed

.dark_embed()

New in version 2.2.

.light_embed()

New in version 2.2.

Other

.default()

.dark_theme()

New in version 1.5.

.random()

New in version 1.6.

  • Name: "insert random colour name here"
  • Hex: #insert random hex here
  • Usage: discord.Colour.random()
  • NOTE: "The random algorithm works by choosing a colour with a random hue but with maxed out saturation and value."

.fuchsia()

New in version 2.0.

.yellow()

New in version 2.0.


Attributes

.value

  • Description: The raw integer colour value.
  • Type: int
  • Usage: discord.Colour(...).value

.r

  • Description: Returns the red component of the colour.
  • Type: int
  • Usage: discord.Colour(...).r

.g

  • Description: Returns the green component of the colour.
  • Type: int
  • Usage: discord.Colour(...).g

.b

  • Description: Returns the blue component of the colour.
  • Type: int
  • Usage: discord.Colour(...).b

Methods

.to_rgb()

  • Description: Tuple[int, int, int]: Returns an (r, g, b) tuple representing the colour.
  • Usage: discord.Colour(...).to_rgb()

(classmethod) .from_rgb()

  • Description: Constructs a Colour from an RGB tuple.
  • Usage: discord.Colour.from_rgb(R, G, B)
  • Example: discord.Colour.from_rgb(88, 101, 242)

(classmethod) .from_hsv()

  • Description: Constructs a Colour from an HSV tuple.
  • Usage: discord.Colour.from_hsv(H, S, V)
  • Example: discord.Colour.from_hsv(235, 64, 95)

(classmethod) .from_str()

New in version 2.0.

  • Description: Constructs a Colour from a string.
  • Usage: discord.Colour.from_str("colour")
  • Example: discord.Colour.from_str("#123456")

                                                                                                                                               🔼 Go Up 🔼

@A-Trash-Coder
Copy link

I love you

Copy link

ghost commented Jun 17, 2020

Useful.

@Soheab
Copy link
Author

Soheab commented Jun 17, 2020

Useful.

ikr

@droolio
Copy link

droolio commented Mar 2, 2021

Can I ask where you got these colours from? Especially the names, like "Aloha" for Teal etc..

Also, what happened to purple? :)

@Soheab
Copy link
Author

Soheab commented Mar 3, 2021

Can I ask where you got these colours from? Especially the names, like "Aloha" for Teal etc..

Also, what happened to purple? :)

All the images and names are from the AlexFlipnote API: https://api.alexflipnote.dev/color/hexherewithouthashtaghere (you will need to ask for a token)

And.. oops. EDIT: added purple and dark purple

@YinSempai
Copy link

do you have the color for links?

@Soheab
Copy link
Author

Soheab commented Jul 7, 2021

do you have the color for links?

What?

@Codingale
Copy link

do you have the color for links?

What?

They want the color links are before visiting them rgb(0, 175, 244) or #00AFF4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment