RGB LED only showing red colour

I wanted to use a RGB led with arduino. I programmed it that it should change colour in one second 1st red, 2nd green, 3rd blue. But it is showing only red.

Circuit connection:
RGB gnd (long leg) to arduino GND
RGB 1st pin (Red) to arduino 9 using 220ohm resistor
RGB 3rd pin(Green) to 10 using 220ohm
RGB 4rd pin (blue) to 11 using 220ohm

Code

int red = 9
int green = 10
int blue = 11

void setup()
{
      pinMode(red, OUTPUT);
      pinMode(green, OUTPUT);
      pinMode(blue, OUTPUT);
}

void loop()
{
      digitalWrite(red, HIGH);
      delay(1000);
      digitalWrite(red, LOW);
      digitalWrite(green, HIGH);
      delay(1000);
      digitalWrite(green, LOW);
      digitalWrite(blue, HIGH);
      delay(1000);
      digitalWrite(blue, LOW);
}

The problem may be in your code that we cannot see

Sorry I forgot to mention code, You can see now, the question is edited

Is it showing red all the time or is red on for 1 second and off for 2 seconds ?

What changes if you swap the connections to pins 9 and 10 or pins 9 and 11 ?

Can you get all colours if you manually connect respectful LED pin to vdd via resistor?

The other two pins don't work only the red is working. I want to know that is the led is working or what could have cause it to malfunction

You haven’t mentioned any potentiometer, where did this come from? Show circuit diagram

The code has nothing in it related to a potentiometer and this is the first time that you have mentioned it

Please post a schematic of your project. A picture of a hand drawn circuit is good enough