veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.18k stars 219 forks source link

Friendly color names #434

Closed dre2004 closed 4 years ago

dre2004 commented 4 years ago

Hello,

Is it possible to have a "friendly" set of color names?

Something similar to this Basic Colors.

I have been able to take that code and modify it slightly for my project but currently I still have to reference each color individually as opposed to just passing LightGray where a RGBA value is expected.

Are colors always hard coded each time you want to use it or is there another preferred way of mapping these ?

Noofbiz commented 4 years ago

There's a colornames package in golang.org/x/image that has a ton of color names, all the ones that you'll find in a browser / the svg spec. https://godoc.org/golang.org/x/image/colornames

dre2004 commented 4 years ago

Thanks!