RGB LED, random colour generator not working

Hello all,
I am very new to both the forum and arduino in general. I have tried out many different sketches to get my rgb led to randomly choose and stay on a colour each time a button is pressed. Instead it continuously cycles through different colours only pausing briefly when the button is pushed. I hope someone can help me, my project is due next week and I am so lost.

// Variables to assign outputs to each color
const int ledRedPin = 10;
const int ledGreenPin = 9;
const int ledBluePin = 8;
// Variable to assign the pin button
const int buttonPin = 2;

// Variables that control the intensity of each color
int red;
int green;
int blue;

// Variable for the state of the button (HIGH or LOW)
int butState;

void setup () {
pinMode (ledRedPin, OUTPUT);
pinMode (ledGreenPin, OUTPUT);
pinMode (ledBluePin, OUTPUT);
pinMode (buttonPin, INPUT);

// initialize colours
red = random(256);
green = random(256);
blue = random (256);
}

void loop() {
// output led
digitalWrite (ledRedPin, red);
digitalWrite (ledGreenPin, green);
digitalWrite (ledBluePin, blue);

butState = digitalRead (buttonPin);
// change colour values
if (butState == HIGH) {
//randomSeed();
red = random(256);
green = random(256);
blue = random (256);
}
}

Make sure your button is wired normally LOW with a resistor to ground (not floating), and your button will need to be debounced, or able to prevent from being held down.

You can fill in the rest and make currState, lastState boolean at the top of the sketch.

currState = digitalRead( 2 );
if( currState != lastState)
{
  lastState = currState;
  if(currState == HIGH)
  {
    // get colors here 
  }
}

Tip, if you know certain variables are not going to exceed (-32,768 to 32,767) = int or (0 to 65,535) = unsigned int, you can make them a byte to save memory. Oh and analogWrite, not digital.

I think you would need to attach the legs of the LED to the PWM pins and use the analogWrite() function because the digitalWrite() function only turns pins on and off. I may be wrong.

Q12-00006:
I think you would need to attach the legs of the LED to the PWM pins and use the analogWrite() function because the digitalWrite() function only turns pins on and off. I may be wrong.

No, your correct, I didn't' see what pins he was using, my error.