Various buttons created programmatically (SwiftUI)

Code: https://github.com/ZT-UC/traffic-light-v1

See files ButtonUIView, ButtonsUIView and ContentView.

There are some comments in them. I hope what I'm trying to accomplish here is clear from comments in ButtonUIView - line 10-11.

Is this even a good approach?

Thanks in advance for any insight / feedback on this.

If not too long, it is much easier for others if you post relevant code directly, instead of forcing to go and browse in a github repository.

Various buttons created programmatically (SwiftUI)
 
 
Q