switching between two if statements

I have two different states, one being it fades, and the other is a blinker on a RGB LED. I want to switch between with a push button switch. I have it switching, but it has to run through the full if statement before it reads the switch, then starts the other if statement. How can I in my code have it break immediately and run other if statement? Anybody want to take a peek at my code and help please.

int redPin = 3;
int greenPin = 5;
int bluePin = 6;
int switchState = 0;
int timeDelay = 500;
int timeDelay2 = 10;


void setup() {
  
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(2, INPUT);
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, HIGH);
digitalWrite(bluePin, HIGH);
}

float redValue;
float greenValue;
float blueValue;

void loop() {
  
  switchState = digitalRead(2);
  
switch
  //If low the RGB fades between color
  if (switchState == LOW) {
  redValue = 255; // choose a value between 1 and 255 to change the color.
  greenValue =0;
  blueValue =0;

  analogWrite(redPin, 0);
  delay(1000);

   for(int i = 0; i < 255; i += 1) // fades out red bring green full when i=255
  {
    redValue -= 1;
    greenValue += 1;
    analogWrite(redPin, 255 - redValue);
    analogWrite(greenPin, 255 - greenValue);
    delay(timeDelay2);
  }

  redValue = 0;
  greenValue = 255;
  blueValue = 0;

  for(int i = 0; i < 255; i += 1)  // fades out green bring blue full when i=255
  {
    greenValue -= 1;
    blueValue += 1;
    analogWrite(greenPin, 255 - greenValue);
    analogWrite(bluePin, 255 - blueValue);
    delay(timeDelay2);
  }

  redValue = 0;
  greenValue = 0;
  blueValue = 255;


  for(int i = 0; i < 255; i += 1)  // fades out blue bring red full when i=255
  {
  redValue += 1;
  blueValue -= 1;
  analogWrite(redPin, 255 - redValue);
  analogWrite(bluePin, 255 - blueValue);
  delay(timeDelay2);
}
  }//end if low  
  
  
  
  
   switchState = digitalRead(2);

  //If high blinks between 7 different colors
   if (switchState == HIGH){
  setColor(255, 0, 0);  // red
  delay(timeDelay);
  setColor(255, 255, 255);  // white
  delay(timeDelay);
  setColor(0, 0, 255);  // blue
  delay(timeDelay);
  setColor(0, 255, 0);  // green
  delay(timeDelay);
  setColor(100, 0, 100);  // purple
  delay(timeDelay);
  setColor(0, 255, 255);  // aqua
  delay(timeDelay);
  setColor(80, 20, 0);  // yellow
  delay(timeDelay); 
}
}


void setColor(int red, int green, int blue)
{
  #ifdef COMMON_ANODE
    red = 255 - red;
    green = 255 - green;
    blue = 255 - blue;
  #endif
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

You need to remove ALL the delay()s from your program. The Arduino can do nothing during a delay().

Have a look at how millis() is used to manage timing without blocking in several things at a time

And if you have any long WHILE or FOR loops you probably need to replace those with IF and code to keep track of the iterations.

...R