src/colour_Func.h
void colortwinkles(){
fadeOutSpeed=35;
Stwinkle = random(150,256);

if (millis() - previousMillis36 > INTERVAL7 && varON == 2 && colorMode == 4) {
      arrayn = random(arrayCount);
      updateOled(24, 40, &arrayn);
      selectcolorArray();
      INTERVAL7=(interval9/5)*timeArray2[random(0,6)]*timefactor3;
      updateOledFloat(88, 0, &INTERVAL7, 0); 
      previousMillis36 = millis();
      T=0;        
}

if (colorMode == 0){
     yval1=yval;}
 else if (colorMode == 1){
     yval1=random(256);} 
 else if (colorMode == 2){
     yval1=random(256);
      while ((yval1 >= ymin && yval1 <= ymax) || (yval1 >= ymin1 && yval1 <= ymax1)){
      yval1=random(256);
      }}
 else if (colorMode == 3){
     yval1=random(256);
      while ((yval1 < ymin || yval1 > ymax) && (yval1 < ymin1 || yval1 > ymax1)){
      yval1=random(256);
      }}
 else if (colorMode == 4){
     yval1=colour[random(0, 15)];
 }
 else if (colorMode == 5){
  colourChangeDelay++;
  if (colourChangeDelay >= 200/changeSpeed){
  yval1++;
  colourChangeDelay=0;}
 }
      
    brightenOrDarkenEachPixel(fadeInSpeed, fadeOutSpeed);

  // if (density == 0){
  //   DENSITY=setDifference;}
  // else if (density == 1){
  //   DENSITY=85;}
  // else if (density == 2){
  //   DENSITY=170;}
  // else if (density == 3){
  //   DENSITY=255;}    

  if( random(255) < setDifference ) {
    int pos = random(NUM_LEDS);
    if( !leds[pos]) {
      leds[pos] = CHSV(yval1,Stwinkle,150);
      setPixelDirection(pos, GETTING_BRIGHTER);
    }
  }
}
/*
 * specifically handles the twinkles. Modified from Mark Kriegman's code. 
 * https://gist.github.com/kriegsman/5408ecd397744ba0393e
 */
specifically handles the twinkles. Modified from Mark Kriegman's code.
specifically handles the twinkles . Modified from Mark Kriegman ' s code .
void colortwinkles(){
fadeOutSpeed=35;
Stwinkle = random(150,256);
if (millis() - previousMillis36 > INTERVAL7 && varON == 2 && colorMode == 4) {
      arrayn = random(arrayCount);
      updateOled(24, 40, &arrayn);
      selectcolorArray();
      INTERVAL7=(interval9/5)*timeArray2[random(0,6)]*timefactor3;
      updateOledFloat(88, 0, &INTERVAL7, 0); 
      previousMillis36 = millis();
      T=0;        
}
if (colorMode == 0){
     yval1=yval;}
 else if (colorMode == 1){
     yval1=random(256);} 
 else if (colorMode == 2){
     yval1=random(256);
      while ((yval1 >= ymin && yval1 <= ymax) || (yval1 >= ymin1 && yval1 <= ymax1)){
      yval1=random(256);
      }}
 else if (colorMode == 3){
     yval1=random(256);
      while ((yval1 < ymin || yval1 > ymax) && (yval1 < ymin1 || yval1 > ymax1)){
      yval1=random(256);
      }}
 else if (colorMode == 4){
     yval1=colour[random(0, 15)];
 }
 else if (colorMode == 5){
  colourChangeDelay++;
  if (colourChangeDelay >= 200/changeSpeed){
  yval1++;
  colourChangeDelay=0;}
 }
    brightenOrDarkenEachPixel(fadeInSpeed, fadeOutSpeed);
  if( random(255) < setDifference ) {
    int pos = random(NUM_LEDS);
    if( !leds[pos]) {
      leds[pos] = CHSV(yval1,Stwinkle,150);
      setPixelDirection(pos, GETTING_BRIGHTER);
    }
  }
}
void colortwinkles ( ) { fadeOutSpeed = 35 ; Stwinkle = random ( 150 , 256 ) ; if ( millis ( ) - previousMillis36 > INTERVAL7 && varON == 2 && colorMode == 4 ) { arrayn = random ( arrayCount ) ; updateOled ( 24 , 40 , & arrayn ) ; selectcolorArray ( ) ; INTERVAL7 = ( interval9 / 5 ) * timeArray2 [ random ( 0 , 6 ) ] * timefactor3 ; updateOledFloat ( 88 , 0 , & INTERVAL7 , 0 ) ; previousMillis36 = millis ( ) ; T = 0 ; } if ( colorMode == 0 ) { yval1 = yval ; } else if ( colorMode == 1 ) { yval1 = random ( 256 ) ; } else if ( colorMode == 2 ) { yval1 = random ( 256 ) ; while ( ( yval1 >= ymin && yval1 <= ymax ) || ( yval1 >= ymin1 && yval1 <= ymax1 ) ) { yval1 = random ( 256 ) ; } } else if ( colorMode == 3 ) { yval1 = random ( 256 ) ; while ( ( yval1 < ymin || yval1 > ymax ) && ( yval1 < ymin1 || yval1 > ymax1 ) ) { yval1 = random ( 256 ) ; } } else if ( colorMode == 4 ) { yval1 = colour [ random ( 0 , 15 ) ] ; } else if ( colorMode == 5 ) { colourChangeDelay ++ ; if ( colourChangeDelay >= 200 / changeSpeed ) { yval1 ++ ; colourChangeDelay = 0 ; } } brightenOrDarkenEachPixel ( fadeInSpeed , fadeOutSpeed ) ; if ( random ( 255 ) < setDifference ) { int pos = random ( NUM_LEDS ) ; if ( ! leds [ pos ] ) { leds [ pos ] = CHSV ( yval1 , Stwinkle , 150 ) ; setPixelDirection ( pos , GETTING_BRIGHTER ) ; } } }
specifically handles the twinkles.
specifically handles the twinkles .
// if (density == 0){ //   DENSITY=setDifference;} // else if (density == 1){ //   DENSITY=85;} // else if (density == 2){ //   DENSITY=170;} // else if (density == 3){ //   DENSITY=255;}    