optimize background-image assignment

I closed the former request, but my replies to your questions are in that post. :)
This request contains two changes:
1.optimize background-image assignment
2.add alpha support for hex representation of color