title: Turn buttons inactive and change opacity
body: <p>I am fairly new to Swift, so please bear with me.</p>
  <p><a href="https://i.stack.imgur.com/zqS6A.png" rel="nofollow noreferrer">screenshot when nothing's tapped</a></p>
  <p><a href="https://i.stack.imgur.com/S9GbE.png" rel="nofollow noreferrer">screenshot when one button is tapped</a></p>
  <p>I am trying to turn the other buttons, which are not tapped, inactive and change the opacity to 0.5.</p>
  <p>So far I have tried using the $bindings but that did not work the way I wanted it to.</p>
  <p>Here is the Code for my SelectionButtons:</p>
  <pre><code>struct SelectionButton: View {
  
  var buttonText = &quot;Selection Button&quot;
  
  var buttonColor = Color.white
  var buttonWidth: CGFloat = 150
  var active = false
  
  
  var body: some View {
      
      ZStack {
          
          if active {
              
              RoundedRectangle(cornerRadius: 45)
                  .frame(width: buttonWidth, height: 50)
                  .foregroundColor(Color(&quot;neonGreen&quot;))
                  .shadow(color: Color(#colorLiteral(red: 0, green: 0, blue: 0, alpha: 0.25)), radius:9, x:0, y:0)
              
              
              Text(buttonText)
                  .font(.system(size: 18))
                  .foregroundColor(.black)
                  .bold()
  
              
          }else{
              RoundedRectangle(cornerRadius: 45)
                  .frame(width: buttonWidth, height: 50)
                  .foregroundColor(buttonColor)
                  .shadow(color: Color(#colorLiteral(red: 0, green: 0, blue: 0, alpha: 0.25)), radius:9, x:0, y:0)
              
              
              Text(buttonText)
                  .font(.system(size: 18))
                  .foregroundColor(.black)
              
          }
          
          
      }
      
  }
  </code></pre>
  <p>And this is how I use them:</p>
  <pre><code>@State var gelbesBlatt = false
  
  var body: some View {
      
      NavigationView {
          
          
          
          Button(action: {
              self.gelbesBlatt.toggle()
          }, label: {SelectionButton(buttonText: &quot;gelb&quot;, buttonColor: .white, buttonWidth: 150, active: gelbesBlatt)
          })
      }
      
      
  }
  </code></pre>
  <p>Thank you!</p>
  <p>If you have an idea how I could add combinations, so that specific buttons which belong together (like &quot;Ganzes Blatt &gt; gelb&quot; and &quot;Ränder &gt; braun&quot;) can be selected together, that would be awesome!</p>