Add opacity support for groups

I want to add support for adding opacity support for groups. This patch works, but I'm not sure if it the right way.Could you advise?

Regarding my project: It's a Uni project about the book "Invisible Cities" by Italo Calvino. Each student is creating on "interactive illustration" for one of the described cities, and in the end they should be all running side by side on ipads. I'm using two.js to animate my cit(ies) which I drew in Illustrator. I'll send you a link once we're done.