RGBa in Internet Explorer

耗尽温柔 提交于 2019-12-04 10:57:27

Looks like it's straight 1-byte hexadecimal, so just do this

Say your opacity is 30%:

.30 * 255 = 76.5
76 -> hex = 4C

You can convert decimal to hex using a variety of desktop tools, online pages, or this JS function:

new Number(76).toString(16);

It's a hexidecimal 99 which is 153 in decimal. type 0x99 in a js console and it will spit out 153. F is the highest digit in hex so typing in 0xff (the highest value for two hex digits) will give you 255. if 255 is 100% and 153 is the value you want to know the percentage of you divide 153 by 255 which results in 0.6.

sure, use a hex to percentage converter like this:

#999999 converts to rgb(60%, 60%, 60%) so 99 = 60%

#BABABA converts to rgb(73%, 73%, 73%) so BA = 73%

you can probably find a better hex converter than the one I've suggested. Remember that hex is base 16, not 10...

As of March 2011, Internet Explorer 9+ DOES process rgba correctly, and, in fact, does so more accurately/thoroughly than [Chrome|Mozilla|Safari]...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!