How to add Transparency information to a HEX color code?
- by TK123
I have to modify some code and the previous developer left this comment:
color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information
On the page there is a color picker that let's the user change text color. It gives HEX values like so:
#RRGGBB
And there is a slider that allows the user to change a text's transparency. It runs from 0.1 to 1
Somehow I need to get a 2 digit letter from this transparency amount and append it to the HEX value for it to work.
Does anyone know how to append Alpga information to HEX color codes? What is the math formula for it?
I guess the question can also be answered if anyone knows how to concert RGBA color values with transparency into HEX:
rgba(255, 255, 255, 0.6)