Turning a normally open switch to a normally closed switch

Hello. I'm fairly new to Arduino. I made a simple project that controls the color of an RGB LED using three potentiometers and an Arduino UNO. I have three potentiometers connected to the UNO that control the intensity of the light in each field. The outputs for blue, green and red leds are biased to a 220 ohm resistor each. The circuit works and I'm planning on adding a switch that turns the circuit ON or OFF but I don't know how.

I have a tact switch available and connected the switch in this configuration. The switch is connected to a 220 ohm pull up resistor. How can I code the UNO so that when I press the switch once the circuit turns ON, retaining the color set by the potentiometers and turn OFF when pressed again? My sample code is written below. I attached a .png file for the circuit.

// Potentiometer Pins
#define bluPot A2
#define grnPot A1
#define redPot A0

// Output Pins
#define bluLED 9
#define grnLED 10
#define redLED 11

// Switch Pin
#define switchInput 8

// Temporary variables
int temp;

void setup() {
  pinMode(bluLED, OUTPUT);
  pinMode(grnLED, OUTPUT);
  pinMode(redLED, OUTPUT);
  Serial.begin(9600);
}

int bluPotControl(int bluVal) {
  bluVal = analogRead(bluPot);
  bluVal = map(bluVal, 0, 1023, 0, 255);
  return bluVal;
}

int grnPotControl(int grnVal) {
  grnVal = analogRead(grnPot);
  grnVal = map(grnVal, 0, 1023, 0, 255);
  return grnVal;
}

int redPotControl(int redVal) {
  redVal = analogRead(redPot);
  redVal = map(redVal, 0, 1023, 0, 255);
  return redVal;
}

void serialDisplay(int bluVal, int grnVal, int redVal) {
  Serial.print("\nbluVal = ");
  Serial.print(bluVal);
  Serial.print("\tgrnVal = ");
  Serial.print(grnVal);
  Serial.print("\tredVal = ");
  Serial.print(redVal);
}

void ledDisplay(int bluVal, int grnVal, int redVal) {
  analogWrite(bluLED, bluVal);
  analogWrite(grnLED, grnVal);
  analogWrite(redLED, redVal);
}

void loop() {
  int bluVal = bluPotControl(temp);
  int grnVal = grnPotControl(temp);
  int redVal = redPotControl(temp);
  ledDisplay(bluVal, grnVal, redVal);
  serialDisplay(bluVal, grnVal, redVal);
}

220 ohm pull up resistor.

Why not use the internal pullup resistor. At any rate, 220 Ohms is too low. Normally a 10K resistor is used unless the switch is far from the Arduino, then the resistor is reduced, but not lower than 1k.

How can I code the UNO so that when I press the switch once the circuit turns ON, retaining the color set by the potentiometers and turn OFF when pressed again?

This demonstrates using the state change detection method to toggle the LED on pin 13 with a momentary switch on pin 8. Instead of toggling the LED, toggle a flag that can be read to allow the main part of the program to run or not.

// this constant won't change:
const byte buttonPin = 8;    // the pin that the pushbutton is attached to
const byte ledPin = 13;       // the pin that the LED is attached to
// Variables will change:
boolean buttonState = 0;         // current state of the button
boolean lastButtonState = 0;     // previous state of the button

void setup()
{
   // initialize the button pin as a input with internal pullup enabled
   pinMode(buttonPin, INPUT_PULLUP);
   // initialize the LED as an output:
   pinMode(ledPin, OUTPUT);
   // initialize serial communication:
   Serial.begin(9600);
}


void loop()
{
   // read the pushbutton input pin:
   buttonState = digitalRead(buttonPin);
   // compare the buttonState to its previous state
   if (buttonState != lastButtonState)
   {
      // if the state has changed, increment the counter
      if (buttonState == LOW)
      {
         // if the current state is LOW then the button
         // went from off to on:
         Serial.println("on");
         digitalWrite(ledPin, !digitalRead(ledPin));
         
      }
      else
      {
         // if the current state is LOW then the button
         // went from on to off:
         Serial.println("off");
      }
      // Delay a little bit to avoid bouncing
      delay(50);
   }
   // save the current state as the last state,
   //for next time through the loop
   lastButtonState = buttonState;
}

Karma for code tags on first post.