himynameisdave / git-labelmaker

:flags: Manage your GitHub labels from the command line!
MIT License
575 stars 33 forks source link

Allow RGB colours #21

Closed Jameskmonger closed 8 years ago

Jameskmonger commented 8 years ago

Rather than only accepting 3/6 digit hex colours, RGB colours could also be accepted as an input.

himynameisdave commented 8 years ago

Amazing, that would be super user friendly!

Okay so do you have any good snippets/modules for converting the incoming RGB values to hexes? I wrote a PostCSS plugin that does literally the opposite of this and will be of no help :sweat_smile:

Jameskmonger commented 8 years ago

@himynameisdave it's easier than it sounds!

Hex colours are also RGB values but just in hex notation. (255,255,255) and (ff,ff,ff) are the same. So you just need to convert each numeric component of the decimal RGB colour into its hexadecimal form and it will be converted! :smile: