Convert #RRGGBB to #AARRGGBB

What value will # 414141 have as #AARRGGBB, but what about # 52b531? How can I convert this using PHP?

Regards,
Pentium10

+5
source share
1 answer

AA is an alpha channel, and a direct conversion would be to set AA to FF to make it fully opaque:

#414141 becomes #FF414141 

(Just add: in some implementations, this means that the number of Transparency, where 00 means full opaque, and FF means completely transparent. In this case, # 00414141 will be correct, but I think this is an exception)

+15
source

All Articles