Error: request for member 'RGB' in 'redLed' , which is of non-class type 'int'
Probably you didn't spot commas:

    analogWrite (redLed,   RGB[0]);
    analogWrite (greenLed, RGB[1]);
    analogWrite (blueLed,  RGB[2]);


The function analogWrite takes two arguments, separated by commas. You were missing some brackets as well.