Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Colors #1587

Open
math280h opened this issue Dec 22, 2024 · 0 comments
Open

Embed Colors #1587

math280h opened this issue Dec 22, 2024 · 0 comments

Comments

@math280h
Copy link

math280h commented Dec 22, 2024

Hi!

Working with discord embed colors is quite annoying and you typically either end up with a rather large hard-coded map or just random integers around.

I'm aware discordgo aims to be a low-level direct mapping to the API but I believe there would be good value in adding a "typed" map of some default colors available in the package kinda like how some of the python libs do.

My suggestion would be to include something like the named CSS Colors by default

This could be something like

type Color int

const (
	Default     Color = 0x000000
	Teal        Color = 0x1abc9c
	DarkTeal    Color = 0x11806a
	Green       Color = 0x2ecc71
	DarkGreen   Color = 0x1f8b4c
	Blue        Color = 0x3498db
	DarkBlue    Color = 0x206694
	Purple      Color = 0x9b59b6
	DarkPurple  Color = 0x71368a
	Magenta     Color = 0xe91e63
	DarkMagenta Color = 0xad1457
	Gold        Color = 0xf1c40f
	DarkGold    Color = 0xc27c0e
	Orange      Color = 0xe67e22
	DarkOrange  Color = 0xa84300
	Red         Color = 0xe74c3c
	DarkRed     Color = 0x992d22
	LighterGrey Color = 0x95a5a6
	DarkGrey    Color = 0x607d8b
	LightGrey   Color = 0x979c9f
	DarkerGrey  Color = 0x546e7a
	Blurple     Color = 0x7289da
	Greyple     Color = 0x99aab5
)

embed := &discordgo.MessageEmbed{
	Color:       DarkBlue,
	Title:       "Test!",
	Description: "Test",
}

I'd be happy to contribute this however because it's a bit out of scope I'm opening this issue to have a discussion first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant