'not declared in this scope' (LIBRARY ISSUE?)

Hi,
I'm new to Arduino, and I'm trying to get my RGB LED to work.
I'm using the pdf made by Arduino to learn, and I copied this code from it.

I thought the error "colorRGB is not declared in this scope" was probably due to I needing to install a library, but I haven't found one. Any thoughts?

int redPin = 9; // R – digital 9
int greenPin = 10; // G – digital 10
int bluePin = 11; // B – digital 11
int potRedPin = 0; // potentiometer 1 – analog 0
int potGreenPin = 1; // potentiometer 2 – analog 1
int potBluePin = 2; // potentiometer 3 – analog 2
void setup(){
pinMode(redPin,OUTPUT);
pinMode(greenPin,OUTPUT);
pinMode(bluePin,OUTPUT);
Serial.begin(9600); // Initialize the serial port
}
void loop(){
int potRed = analogRead(potRedPin);
int potGreen = analogRead(potGreenPin); // read value from potentiometer of green LED
int potBlue = analogRead(potBluePin); // read value from potentiometer of blue LED
int val1 = map(potRed,0,1023,0,255);
int val2 = map(potGreen,0,1023,0,255);
int val3 = map(potBlue,0,1023,0,255);

// print value of red, green and blues LEDs from serial port
Serial.print("Red:");
Serial.print(val1);
Serial.print("Green:");
Serial.print(val2);
Serial.print("Blue:");
Serial.println(val3);
colorRGB(val1,val2,val3);
}
}
//define the colorRGB function
void colorRGB(int red, int green, int blue){
analogWrite(redPin,constrain(red,0,255));
analogWrite(greenPin,constrain(green,0,255));
analogWrite(bluePin,constrain(blue,0,255));
}

Look at the two lines after the call to colorRGB.

Why two closing braces?

Please remember to use code tags when posting code.
Also the IDE has a very useful control to copy error messages, should they occur.
Please use it.

This is not a bootloader issue.

  1. use code tags (highlight the code in your post, and click the </> button. It makes it much easier to read.
  2. Post the full text of any and all error messages - click the button to copy all the errors to the clipboard, so you can easily paste them in here. (Use code tags for those too).
  3. When you do this, you will discover that there were other errors - specifically one relating to that extra close bracket. The compiler is not recognizing your declaration of ColorRGB() because of the syntax error before it.