himynameisdave/git-labelmaker

Allow RGB colours

Closed this issue · 2 comments

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

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 😅

@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! 😄