pevegaf678
pevegaf678

Reputation: 43

Color embeds in discord.py

So i'm trying to make the bot visualize different hex colors, but there is some problems with the hex color #FFFFFF, on google you can see its white, but if I do embed = discord.Embed(color=0xFFFFFF) it's a black color is there some other way to do this for it to work the way I want?

Tried this, but still black

r = 255 #temp testing
g = 255 #temp testing
b = 255 #temp testing
embed = discord.Embed(color=discord.Color.from_rgb(r, g, b))

Upvotes: 1

Views: 3694

Answers (2)

pevegaf678
pevegaf678

Reputation: 43

This is probably bad code, but since it seems like color #ffffff is not allowed I did this to make it work.

if hexxx == 'FFFFFF':
   hexxx = 'FFFFFE'

This seems to work, but if anyone has a better answer please tell.

White square

Upvotes: 3

Stoobish
Stoobish

Reputation: 1362

I raised an issue in the Discord.py Github repo and was told that its not an API issue but Discord reserves pure black and pure white embeds for their own use to allow it to be theme friendly.

The recommended solution is to use a different hexcode that is closest to white similar to what @pevegaf678 said.

Upvotes: 0

Related Questions