Need HELP. Code for RGB LED's individually calling them

I am very new to the C language and I am having troubles calling individual LED's. I have pulled down some code off-line and added some buttons. The project is a 3rd brake light and using the RGB to change it to mini light bar. I am only using Red and Blue. I have managed to eek my way through but I am having difficulty with controlling each LED individually. I tried a digitalWrite in a void at the bottom of the void loop but it only writes the first block of blueLED's. I was trying to get it to scroll in the opposite direction as well, which did not work. I need a little guidance with one or two of the LED's and I will add the rest of the code. I know delay is evil but I thought I could get away with it. Having the redLED's go on solid after the 3rd blink would be a plus. I am using common anode LED's if that makes a difference?
Thanks in advance because I am coming from old school line number basic background with goto's and gosub's and not used to having just one loop and unfamiliar syntax.

int blueLED1 = 2;
int blueLED2 = 4;
int blueLED3 = 6;
int blueLED4 = 8;
int blueLED5 = 10;
int blueLED6 = 12;
int blueLED7 = A0;
int blueLED8 = A2;

int redLED1 = 3;
int redLED2 = 5;
int redLED3 = 7;
int redLED4 = 9;
int redLED5 = 11;
int redLED6 = 13;
int redLED7 = A1;
int redLED8 = A3;

int button =A5;
int button2= A4;

int i=75;
int count=0;

void setup()
{
Serial.begin(9600);
pinMode(redLED1, OUTPUT);
pinMode(redLED2, OUTPUT);
pinMode(redLED3, OUTPUT);
pinMode(redLED4, OUTPUT);
pinMode(redLED5, OUTPUT);
pinMode(redLED6, OUTPUT);
pinMode(redLED7, OUTPUT);
pinMode(redLED8, OUTPUT);

pinMode(blueLED1, OUTPUT);
pinMode(blueLED2, OUTPUT);
pinMode(blueLED3, OUTPUT);
pinMode(blueLED4, OUTPUT);
pinMode(blueLED5, OUTPUT);
pinMode(blueLED6, OUTPUT);
pinMode(blueLED7, OUTPUT);
pinMode(blueLED8, OUTPUT);

pinMode(button,INPUT);
pinMode(button2,INPUT);

}

void loop()
{

// RED BUTTON ROUTINE
if(digitalRead(button) ==HIGH)
{setColor(0, 0, 255);

}

else{setColor(255,255,255);}

// BLUE BUTTON ROUTINE

if(digitalRead(button2) ==HIGH)

{ setColor(255,0,0);delay(20);setColor(255,255,255);delay(20);
setColor(0,0,255);delay(20);setColor(255,255,255);delay(20);}
else
{ setColor(255,255,255); }

}

void setColor(int redValue, int greenValue, int blueValue) {
analogWrite(redLED1, redValue);
analogWrite(redLED2, redValue);
analogWrite(redLED3, redValue);
analogWrite(redLED4, redValue);
analogWrite(redLED5, redValue);
analogWrite(redLED6, redValue);
analogWrite(redLED7, redValue);
analogWrite(redLED8, redValue);

analogWrite(blueLED1, blueValue);
analogWrite(blueLED2, blueValue);delay(20);
analogWrite(blueLED3, blueValue);delay(20);
analogWrite(blueLED4, blueValue);delay(20);
analogWrite(blueLED5, blueValue);delay(20);
analogWrite(blueLED6, blueValue);delay(20);
analogWrite(blueLED7, blueValue);delay(20);
analogWrite(blueLED8, blueValue);delay(20);

analogWrite(blueLED8, blueValue);delay(20);
analogWrite(blueLED7, blueValue);delay(20);
analogWrite(blueLED6, blueValue);delay(20);
analogWrite(blueLED5, blueValue);delay(20);
analogWrite(blueLED4, blueValue);delay(20);
analogWrite(blueLED3, blueValue);delay(20);
analogWrite(blueLED2, blueValue);delay(20);
analogWrite(blueLED1, blueValue);delay(20);

}

How are the two buttons supposed to work? Right now, if either one isn't pressed then that one goes in the else part and sets all colors to 255. So both buttons have to be pressed for anything to happen. Is that what you wanted? You didn't really describe how it should work. That's pretty important information.

Please read the "How to use this forum" thread. Please format your code, nobody wants to deal with all those multiple statements on a line. That's not how we write. Press Control-T in the IDE and it will format it for you. Also please post code in code tags.

The number one thing that separates a good coder from a crappy one is the tendency to read the instructions first.

Right now one button works the blueLED's and the other button works the redLED's. They are both functioning and all of the LED's go off when the buttons are not pressed.

Just because I'm feeling generous,

int blueLED1 = 2;
int blueLED2 = 4;
int blueLED3 = 6;
int blueLED4 = 8;
int blueLED5 = 10;
int blueLED6 = 12;
int blueLED7 = A0;
int blueLED8 = A2;

int redLED1 = 3;
int redLED2 = 5;
int redLED3 = 7;
int redLED4 = 9;
int redLED5 = 11;
int redLED6 = 13;
int redLED7 = A1;
int redLED8 = A3;

int button =A5;
int button2= A4;

int i=75;
int count=0;

void setup()
{
    Serial.begin(9600);
    pinMode(redLED1, OUTPUT);
    pinMode(redLED2, OUTPUT);
    pinMode(redLED3, OUTPUT);
    pinMode(redLED4, OUTPUT);
    pinMode(redLED5, OUTPUT);
    pinMode(redLED6, OUTPUT);
    pinMode(redLED7, OUTPUT);
    pinMode(redLED8, OUTPUT);

    pinMode(blueLED1, OUTPUT);
    pinMode(blueLED2, OUTPUT);
    pinMode(blueLED3, OUTPUT);
    pinMode(blueLED4, OUTPUT);
    pinMode(blueLED5, OUTPUT);
    pinMode(blueLED6, OUTPUT);
    pinMode(blueLED7, OUTPUT);
    pinMode(blueLED8, OUTPUT);

    pinMode(button,INPUT);
    pinMode(button2,INPUT);
}

void loop()
{
    // RED BUTTON ROUTINE
    if(digitalRead(button) ==HIGH)
    {
        setColor(0, 0, 255);
    }
    else
    {
        setColor(255,255,255);
    }

    // BLUE BUTTON ROUTINE

    if(digitalRead(button2) ==HIGH)
    { 
        setColor(255,0,0);
        delay(20);
        setColor(255,255,255);
        delay(20);
        setColor(0,0,255);
        delay(20);
        setColor(255,255,255);
        delay(20);
    }
    else
    { 
        setColor(255,255,255);  
    }
}

void setColor(int redValue, int greenValue, int blueValue) 
{
    analogWrite(redLED1, redValue);
    analogWrite(redLED2, redValue);
    analogWrite(redLED3, redValue);
    analogWrite(redLED4, redValue);
    analogWrite(redLED5, redValue);
    analogWrite(redLED6, redValue);
    analogWrite(redLED7, redValue);
    analogWrite(redLED8, redValue);

    analogWrite(blueLED1, blueValue);
    analogWrite(blueLED2, blueValue);
    delay(20);
    analogWrite(blueLED3, blueValue);
    delay(20);
    analogWrite(blueLED4, blueValue);
    delay(20);
    analogWrite(blueLED5, blueValue);
    delay(20);
    analogWrite(blueLED6, blueValue);
    delay(20);
    analogWrite(blueLED7, blueValue);
    delay(20);
    analogWrite(blueLED8, blueValue);
    delay(20);

    analogWrite(blueLED8, blueValue);
    delay(20);
    analogWrite(blueLED7, blueValue);
    delay(20);
    analogWrite(blueLED6, blueValue);
    delay(20);
    analogWrite(blueLED5, blueValue);
    delay(20);
    analogWrite(blueLED4, blueValue);
    delay(20);
    analogWrite(blueLED3, blueValue);
    delay(20);
    analogWrite(blueLED2, blueValue);
    delay(20);
    analogWrite(blueLED1, blueValue);
    delay(20);
}

One line, one semi-colon terminated statement or one brace (curly bracket).

Your second block of analogWrite to the blue LEDs does nothing, as blueValue hasn't changed.

What do you think the 20ms delays accomplish?

As D_G mentioned, if either button is not pressed, the color will be set at 255,255,255. The loop will happen too quickly for you to notice any change. You need to test and set a condition WHEN a button is pushed, not IF.

You also need to look seriously into using arrays to define your LED pins as it will make trying to do what you want much simpler. If you want 'cylon' lighting, you need to turn each LED off before you turn the next one on.

DKWatson:
If you want 'cylon' lighting, you need to turn each LED off before you turn the next one on.

Repectfully disagree artistically speaking for vintage cyclon eyes.

Should have 5 LEDs lit at all times , Center full brightness, inner left/right 66% brightness, and outer left/right at 33%. You move the brightness levels. Once a 33% LED hits a side, you trigger counter backwards so that it spends 2 cycles on the same spot.

A diffusion screen innfront of the LEDs would help also..

@Slumpert
I bow to your superior Alien knowledge. I haven't seen an episode of BG this century. So how is the brightness if most left (call it 1) is 100%, 2 @ 66%, 3 @ 33%, 4 and 5?

Original TV prop was likely simply a light getting moved physically back and forth.

Hard to replicate that level of authentic sci-fi technology.