How do I get HTML Color Picker to return RGB values
I am more than capable of converting the Hex values to RGB, but just wondering if there was a setting on the Color Input to automatically return RGB or RGBA values instead of the Hex ones
13 Replies
no, there isn't
it returns
#rrggbb
and that's itahhhh, ok thanks, i've been googling and couldn;t find anything. so maths it is then 🙂
if you need it in rgb, you have to convert it yourself
it's not hard
oh i know it's easy enough, i just wanted to keep my code as short as possible
you don't have to worry about that
that's the dumbest thing you should worry about
just make sure you write the best code you can
leave the size for the bundler
you will read the code more often than you write it
so, make sure that you can read it in 10 years
thank you 🙂
you're welcome
i have a small solution for you
no math needed, generates rgb values
if you must squeeze every byte out of it, you can do this cursed thing:
If you're on Windows use the color picker tool in Power Toys and you can access whatever variant you need.
Also if you mean in the developer console. You can change it easily with Chrome or Firefox
he wants a color input on the website
Noted! That seems interesting!
it's a simple
<input type="color">
Noted! I've only recently been getting back into everything. So I haven't touched inputs yet since the site I've been using doesn't allow for them.
But either way, thanks for the heads up!
you're welcome