Refix the rgba bug and handle elements with transparent backgrounds

In the previous commit, the rgba fix was rebroken. It's fixed here. We also climb up the dom when the given element has a transparent background.