Multiple display modes with push buttons

I’m building a spectrum analyzer with the 16x32 RGB LED matrix from Adafruit and an Arduino Uno.
I would like to have two display modes (for example : displaying the leds in green or blue ) so I’ve connected two buttons to digital Pin 10 and 11.
( wired like this : http://arduino.cc/en/Tutorial/button )
The problem is that I have to keep the button pressed or you won’t see any changes from the leds. If i release the button it stands still at the last value it had.
Switching trough the 2 display modes works though, it’s just that the values of the array keep changing (so the buttons have to be pressed in).
I believe the problem could be fixed with some kind of flag system but it didn’t work out for me yet.
Maybe someone knows a sollution ?
Didn’t put the whole code. Just the if/else statement:

  if ( prevButtonState1== HIGH && millis() - time > debounce) //if button 1 on, purple to blue mode on
  {     
     for (int y = 0; y < 16; y++)
     {
       for (int x = 1; x < 64; x++)
       {
         int z =data_avgs[x]+data_avgs[x+1];
         if (z > y && (x & 0x01) == 0)
         {
            matrix.drawPixel((x/2),15-y,1792);  //leds displayed in green 
         } 
       }
      }
   for (int y = 0; y < 16; y++)
   {
     for (int x = 1; x < 64; x++)
     {
         int z =data_avgs[x]+data_avgs[x+1];
         if (z < y && (x & 0x01) == 0) matrix.drawPixel((x/2),15-y,matrix.Color333(0,0,0));//matrix.drawPixel is het schrijf funcite van 1 pixel met de x en y coördinaat. Met matrix.Color333 kan je een RGB kleur kiezen
     }
   }
    prevButtonState1 = buttonState1;
  }
  else if( prevButtonState2== HIGH) //If button 2 on, mode blue on
  { 
    for (int y = 0; y < 16; y++)
    {
       for (int x = 1; x < 64; x++)
       {
         int z =data_avgs[x]+data_avgs[x+1];
         if (z > y && (x & 0x01) == 0)
         {
            matrix.drawPixel((x/2),15-y,31);  //leds displayed in blue
         } 
       }
    }
   for (int y = 0; y < 16; y++)
   {
     for (int x = 1; x < 64; x++)
     {
        int z =data_avgs[x]+data_avgs[x+1];
        if (z < y && (x & 0x01) == 0) matrix.drawPixel((x/2),15-y,matrix.Color333(0,0,0));//matrix.drawPixel is het schrijf funcite van 1 pixel met de x en y coördinaat. Met matrix.Color333 kan je een RGB kleur kiezen
     }
   }
    prevButtonState2 = buttonState2;
  }
    else
    {
      prevButtonState1 = buttonState1;
      prevButtonState2 = buttonState2;
    }
}
I believe the problem could be fixed with some kind of flag system but it didn't work out for me yet.

Possibly.

  if ( prevButtonState1== HIGH && millis() - time > debounce) //if button 1 on, purple to blue mode on

This statement requires that the state remain HIGH, although that should be true as nothing ever changes the state.

Of course, the code you posted was poorly indented and incomplete. Post ALL of your code AFTER using Tools + Auto Format.