2x2 RGB LED matrix help

I am trying to get the Button Pad 2x2 - Breakout PCB - COM-09277 - SparkFun Electronics working on an Arduino Micro using the following code

/*
2x2 RGB LED Control
This is for control of Sparkfun's 2x2 RGB Button Pad.
http://www.sparkfun.com/commerce/product_info.php?products_id=9277

Aaron Goselin (Nakor)
Oct 27, 2010

This code is in the public domain.
*/

// Button Grounds
const int buttonMatrix1 = 12;
const int buttonMatrix2 = 7;
const int buttonMatrix3 = 13;
const int buttonMatrix4 = 11;
// LED Grounds
const int ledGnd1 = 10;
const int ledGnd2 = 11;
const int ledGnd3 = 12;
const int ledGnd4 = 13;
// RGB pins
const int redLED = 4;
const int greenLED = 5;
const int blueLED = 6;

// Colour definitions
int red[] = {255, 0, 0};
int green[] = {0, 255, 0};
int blue[] = {0, 0, 255};
int purple[] = {255, 0, 150};
int yellow[] = {255, 255, 0};
int dark[] = {0, 0, 0};

void setup() 
{ 
// Switch Grounds
pinMode(buttonMatrix1, INPUT);
pinMode(buttonMatrix2, INPUT);
pinMode(buttonMatrix3, INPUT);
pinMode(buttonMatrix4, INPUT);

// Led grounds
pinMode(ledGnd1, OUTPUT);
pinMode(ledGnd2, OUTPUT);
pinMode(ledGnd3, OUTPUT);
pinMode(ledGnd4, OUTPUT);

// RGB pins
pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(blueLED, OUTPUT);

// Serial if you need it 
//Serial.begin(115200);
}

void loop() {

// Pass in the colour of your buttons 1, 2, 3, and 4.
ledColour(yellow, red, purple, green);

// Uniform colour. Pass in the colour array of your choice.
//ledColourU(purple);

// Dark is just off. Use dark to turn any LED off.
//ledColour(dark, dark, dark, dark);

/*
// Check for button presses and output states
// Enable if you want to test your buttons
Serial.print(digitalRead(buttonMatrix1));
Serial.print("\t");
Serial.print(digitalRead(buttonMatrix2));
Serial.print("\t");
Serial.print(digitalRead(buttonMatrix3));
Serial.print("\t");
Serial.println(digitalRead(buttonMatrix4));
*/

}

// Control individual LEDs
// Pass in a colour array for each LED
void ledColour(int led1[], int led2[], int led3[], int led4[])
{
analogWrite(redLED, led1[0]);
analogWrite(greenLED, led1[1]);
analogWrite(blueLED, led1[2]);
// Flicker control
delay(2);
digitalWrite(ledGnd1, LOW);
// Flicker control
delayMicroseconds(1100);
digitalWrite(ledGnd1, HIGH);

analogWrite(redLED, led2[0]);
analogWrite(greenLED, led2[1]);
analogWrite(blueLED, led2[2]);
// Flicker control
delay(2);
digitalWrite(ledGnd2, LOW);
// Flicker control
delayMicroseconds(1100);
digitalWrite(ledGnd2, HIGH);

analogWrite(redLED, led3[0]);
analogWrite(greenLED, led3[1]);
analogWrite(blueLED, led3[2]);
// Flicker control
delay(2);
digitalWrite(ledGnd3, LOW);
// Flicker control
delayMicroseconds(1100);
digitalWrite(ledGnd3, HIGH);

analogWrite(redLED, led4[0]);
analogWrite(greenLED, led4[1]);
analogWrite(blueLED, led4[2]);
// Flicker control
delay(2);
digitalWrite(ledGnd4, LOW);
// Flicker control
delayMicroseconds(1100);
digitalWrite(ledGnd4, HIGH);

}

// Uniform colour
// This doesn't appear to work well with mixed colours.
void ledColourU(int colour[])
{
analogWrite(redLED, colour[0]);
analogWrite(greenLED, colour[1]);
analogWrite(blueLED, colour[2]);
digitalWrite(ledGnd1, LOW);
digitalWrite(ledGnd2, LOW);
digitalWrite(ledGnd3, LOW);
digitalWrite(ledGnd4, LOW); 
}

(modified for the pins that I am using.) The issue is that I want the LEDs to start in the setup as red, green, blue and yellow. I dont want the colors to change. I cant seem to make the buttons stay lit. I am thinking since I dont need any change in the color of the LEDs that by setting the output in void setup I can let the following code look less crappy and inefficient than it already is.

const int buttonPin = A3;    // pin to read button
const int mode1 = 2;       // relay 1
const int mode2 = 7;     // relay 2
const int mode3 = 8;       // relay 3\
const int L1 = 1;       // relay 1
const int L2 = 0;     // relay 2
const int L3 = 9;       // relay 3
const int SL = 3;       // relay for save/load button
int state = 1;           // Which relay is currently on.
 
void setup()
{
  Serial.begin(9600);
  const int L1 = 1;
  pinMode(buttonPin, INPUT);
  pinMode(mode1, OUTPUT);
  pinMode(mode2, OUTPUT);
  pinMode(mode3, OUTPUT);
  pinMode(L1, OUTPUT);
  pinMode(L2, OUTPUT);
  pinMode(L3, OUTPUT);
  pinMode(SL, OUTPUT);
  digitalWrite(mode1, HIGH);
  digitalWrite(SL, HIGH);
}
 
void loop()
{
  if( analogRead(buttonPin) ) {
   const int L1 = 1;
    // debounce
    delay(200);
    
    if (state == 1) {
      digitalWrite(mode3, LOW);
      state = 2;
       digitalWrite(L2, LOW);
      digitalWrite(L3, LOW);
       delay(200);
      digitalWrite(L1, HIGH);
      digitalWrite(mode1, HIGH);
       delay(200);
      digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
    }
    else if (state == 2) {
      digitalWrite(mode1, LOW);
      state = 3;
      digitalWrite(L1, LOW);
       delay(200);
      digitalWrite(L2, HIGH);
      digitalWrite(mode2, HIGH);
       delay(200);
       digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
    }
    else if (state == 3) {
      digitalWrite(mode2, LOW);
      state = 1;
      digitalWrite(L2, LOW);
       delay(200);
      digitalWrite(L3, HIGH);
      digitalWrite(mode3, HIGH);
       delay(200);
      digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
      delay(50);
      digitalWrite(SL, LOW);
      delay(50);
      digitalWrite(SL, HIGH);
    }
    
    while(analogRead(buttonPin));  // wait until the button is released
    delay(200);      // debounce
  Serial.println(state);
  Serial.print("\t");  
  Serial.print(mode1);
  Serial.print("\t");  
  Serial.print(mode2);
  Serial.print("\t");  
  Serial.print(mode3);
  Serial.print("\t");  
  Serial.print(L1);
  Serial.print("\t");  
  Serial.print(L2);
  Serial.print("\t");  
  Serial.print(L3);
  Serial.print("\t");  
  Serial.println(SL);
  Serial.print("\t");  
}
}

Quick question, what are the "ledGnd"s? Because if they are connected to the 3 GND pins on the RGB LED's then you should not be setting them to HIGH because that will block them from going to GND, and therefore turn off the LED's. Are the lights turning on at all or do they turn on for a while and just turn off randomly? You can set the LED's in the setup and they shouldn't change after that unless something is wrong with the code.

No, the ledGnd pins are connected to the common cathode on the leds. RGB pins are 4, 5, 6. I can get the leds to turn on but not in any particular color scheme that I can adjust (I am thinking that each led should have a PWM value assigned to each color. I am not sure how to accomplish this in the void setup.) I'm only 4 months along in terms of circuit building and Arduino so most of my coding and circuitry is pretty amateurish.

Ok so from what I understand you have the ledGnd's connected to pins 10, 11, 12, 13 and the RGB pins connected to pins 4, 5, 6 right? The way that the button pad works is you can set all the leds to be one color by changing the ledGnd's to low and setting which color you want with the RGB pins. To control individual leds you have to set all the ledGnd's to HIGH except for the one you want to set to be a color, flash the color you want, set its ledGnd pin to HIGH, move to the next one, flash its color and so on, so quickly that the eye cannot detect the flashing. You shouldn't need to use pwm at all except for the yellow color and I would have no idea how to go about implementing that. The issue is that you would need to call the function that flashes each of the button pad LED's quite quickly, every few cycles, in order for them to have individual colors. There would be no way for a function in void setup() to set the led's color values and then move on with them holding the color they were assigned. Does that make sense? If you wanted the whole array to be red then you could set it in void setup() and just leave the pins in their respective states but to have them different colors you would need to set them every couple of cycles.