inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Aug 23, 2013 12:06:09 GMT -8
I'm trying to create a css gradient that will go over a div and make it fade from transparent to opaque. However, everything but IE uses RGBA. IE uses an eight character hexidecimal, and I need to convert the RBGA numbers to a hex number, but I have no idea how. Any help? I searched around for some stuff but couldn't find anything that worked.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Aug 23, 2013 12:51:45 GMT -8
You should be able to do a straight conversion. E.g., 0 = 0 and ff = 255. Write a function that translates from hex to decimal (or vice versa, depending on which direction you need), then split your string every two characters and run them each through that function.
Hint:
hexString = yourNumber.toString(16); yourNumber = parseInt(hexString, 16);
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Aug 23, 2013 13:11:42 GMT -8
Thanks, I actually had figured it out just a second ago and I'd come to remove my post, but thanks for taking the time to explain.
|
|