Neopixel effect on selected pixels

I'm trying to figure out how to show a neopixel effect like whiteOverRainbow on e few pixel.
It's for a wordclock. The string is 255 pixels long and at a certain moment i want to whiteOverRainbow to show over the pixels 0,1,3,5,6,130,131,132,133,135,136,137,138,140,141,154,153,152,151,150,149,148,147,146.

Can somebody help me?

This is the whiteOverRainbow part of the code.

void whiteOverRainbow(uint8_t wait, uint8_t whiteSpeed, uint8_t whiteLength ) {

if(whiteLength >= strip.numPixels()) whiteLength = strip.numPixels() - 1;

int head = whiteLength - 1;
int tail = 0;

int loops = 3;
int loopNum = 0;

static unsigned long lastTime = 0;

while(true){
for(int j=0; j<256; j++) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
if((i >= tail && i <= head) || (tail > head && i >= tail) || (tail > head && i <= head) ){
strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
}
else{
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}

}

if(millis() - lastTime > whiteSpeed) {
head++;
tail++;
if(head == strip.numPixels()){
loopNum++;
}
lastTime = millis();
}

if(loopNum == loops) return;

head%=strip.numPixels();
tail%=strip.numPixels();
strip.show();
delay(wait);
}
}

}

first step: Please put your code in Code tags.

It is probably the case that the rainbow effect requires a fair few pixels in order to allow a gradient of colors.

If you alter the function then the effect will probably end up nothing like the rainbow effect.

Perhaps you should code your own effect that is ideal for a few pixels?

i want to whiteOverRainbow to show over the pixels 0,1,3,5,6,130,131,132,133,135,136,137,138,140,141,154,153,152,151,150,149,148,147,146.

So you put those numbers in an array and when you want to set a pixel colour of a specific LED say in a loop with an index i then you use myArray[ i ] instead. Note the loop must run not over the full number of LEDs you have but only over the number of LEDs you want to use. That is the number of values in your array.