To quickly convert from a view's color to opacity, you can add the .luminanceToAlpha() view modifier. The problem is that it will change the opacity even in normal (non-tinted) mode. So I created a custom view modifier that only applies this filter if we're in the tinted mode.