Whats is wrong here? I am trying to make a code that combines LDR and RGB LED

Well not for the LEDs anyways. It may be from one of the libraries included, to set the drawing color for subsequent graphics calls.

To make colors on you RGB LED you have to turn on the components you want, and turn off the ones you don’t. So

      digitalWrite(redPin , HIGH);
      digitalWrite(greenPin , HIGH);
      digitalWrite(bluePin, LOW);

would make it one of the 8 possible full on colors available if we doing no color, off.

HTH

a7