Arduino with WS2812 using Adafruit NeoPixel library fade in/out different patterns
To make randomly-changing colours for the whole strip, change:

void loop() {
  rgbFadeInAndOut(0, 0, 255, ledFadeTime); // Blue
}


to:

void loop() {
  rgbFadeInAndOut(random (256), 
                  random (256), 
                  random (256), ledFadeTime); // random colour
}




If you want to make individual pixels different colours you could set up an array of colours, randomly initialize it, and use that. Like this:

#include &lt;Adafruit_NeoPixel.h&gt;

int PIN = 3;
int totalLEDs = 11;
int ledFadeTime = 5;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(totalLEDs, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  rgbFadeInAndOut(ledFadeTime);
}

void rgbFadeInAndOut(uint8_t wait) {

  uint8_t red [totalLEDs];
  uint8_t green [totalLEDs];
  uint8_t blue [totalLEDs];

  // randomly set each colour
  for (int i = 0; i &lt; totalLEDs; i++)
    {
    red [i] = random(256);
    green [i] = random(256);
    blue [i] = random(256);
    }

  for(uint8_t b = 0; b &lt;255; b++) {
     for(uint8_t i=0; i &lt; strip.numPixels(); i++) {
        strip.setPixelColor(i, red [i] * b/255, green [i] * b/255, blue [i] * b/255);
     }

     strip.show();
     delay(wait);
  }

  for(uint8_t b=255; b &gt; 0; b--) {
     for(uint8_t i = 0; i &lt; strip.numPixels(); i++) {
        strip.setPixelColor(i, red [i] * b/255, green [i] * b/255, blue [i] * b/255);
     }
     strip.show();
     delay(wait);
  }
}