button to activate rgb led and ignore

i am still trying to find a way to code this
if button 1 is pressed it will ignore the command even if button 2 3 4 is press

if button 2 is press it will ignore button 3 4
if button 3 is press it will ignore button 4

meaning button 1,2,3 will overwrite button 4
And button 1,2 will over write button 3,4
button 1 will over write button 2,3,4

i only manage to code until this but i don know which command can help me complete my task
it will be best if example is provided
i am very keen on learning but i do not know where to start and what to code

int BluePin = 9;
int RedPin = 10;
int GreenPin = 11;
const int buttonPin1 = 2;
const int buttonPin2 = 3;
const int buttonPin3 = 4;
const int buttonPin4 = 5;
boolean ledState; // on or off
unsigned long ledTime; // when leds were turned on
unsigned long interval = 5000; // burn time
int red  = 0;
int green  = 0;
int blue = 0;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
void setColor(int red, int green, int blue)
{
  analogWrite(RedPin, red);
  analogWrite(GreenPin, green);
  analogWrite(BluePin, blue);
}
void setup() {

  Serial.begin(9600);
  pinMode(BluePin, OUTPUT);
  pinMode(RedPin, OUTPUT);
  pinMode(GreenPin, OUTPUT);
  pinMode(buttonPin1, INPUT);
  pinMode(buttonPin2, INPUT);
  pinMode(buttonPin3, INPUT);
  pinMode(buttonPin4, INPUT);
}

void loop() {
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  buttonState4 = digitalRead(buttonPin4);

  if (buttonState1 = HIGH) {

    { setColor(0, 255, 0);
      if (buttonState2 = HIGH) {
        setColor(0, 255, 0);
      }
      { setColor(0, 255, 0);

      }
      if (buttonState3 = HIGH)
      { setColor(255, 0, 0);
      }
      if (buttonState4 = HIGH)
      { setColor(80, 0, 80);
      }

    }
    ledState = true; // remember led(s) are on
    ledTime = millis(); // note the time
  }
  if (ledState && millis() - ledTime > interval) { // if a led is on and time is up
    {
      setColor(0, 0, 0);
      ledState = false; // leds are off
    };


  }
}

if (buttonState1 = HIGH) {

{setColor(0, 255, 0 ) ;
if (buttonState2 = HIGH) {
setColor(0, 255, 0);
}
{ setColor(0, 255, 0 ) ;

}

Red - this code is always run irrespective of any value of the variable buttonState
Green - Unnecessary braces

Click just after an opening brace and you will see the corresponding closing brace outlined.

Unless you have an "if" or a "while" statement then there is no need for code to be in braces. You seem to be mixed up about how to use them.

Is this what you want?

void loop() {
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  buttonState4 = digitalRead(buttonPin4);

  if (buttonState1 = HIGH) setColor(0, 255, 0);     
  else if (buttonState2 = HIGH) setColor(0, 255, 0);
  else if (buttonState3 = HIGH) setColor(255, 0, 0);
  else if (buttonState4 = HIGH) setColor(80, 0, 80);


    ledState = true; // remember led(s) are on
    ledTime = millis(); // note the time
 
  if (ledState && millis() - ledTime > interval) { // if a led is on and time is up
      setColor(0, 0, 0);
      ledState = false; // leds are off
    }
}

For some reason I like to have pin numbers in arrays... Reading buttons with a defined priority would look like:

#define BUTTONCOUNT 4
int buttonpins[BUTTONCOUNT] = {2, 3, 4, 5};


void setup(){
	...
	for( int buttonidx=0; buttonidx<BUTTONCOUNT; buttonidx++){
		pinMode(buttonpins[buttonidx], INPUT_PULLUP);
	}
	...
}

int getButton(){
	/*
		Returns the index of the pressed button
		-1 when nothing is pressed
	*/
	int ret = -1;
	for( int buttonidx=0; buttonidx<BUTTONCOUNT; buttonidx++){
		if(digialread(buttonpins[buttonidx]) == LOW){
			ret = buttonidx;
			break;
		}
	}
	return ret;
}


int oldbutton = -1;
void loop(){
	int newbutton = getButton();
	if( oldbutton != newbutton){
		oldbutton = newbutton;
		
		switch(newbuton){
			case 0: setColor(0, 255, 0); break;
			case 1: setColor(255, 0, 0); break;
			...
		}
		ledState = true;
		ledTime = millis();
	}

	if (ledState && millis() - ledTime > interval) {
		setColor(0, 0, 0);
		ledState = false;
	};
}

The pin is using the internal pullup --> the button needs to connect the pin to GND.