Code Help: Trying to use color pallettes with button change

(edit) Looking for help trying to use a state machine like this fellow maker shared with me, to display Color Pallette FastLEd options instead of adafruitneopixel library.
I am very new and trying to learn this stuff.
I am having a hard time disecting the formulas to be able to see what i can use and replace, but they are both so different, Im hacving a hard time. My reply post has more detail of what I am tryign to accomplish
thank you

#import <Adafruit_NeoPixel.h>;

//---------------------------
// Parameters
// NeoPixel parameters
#define LED_PIN           6
#define LED_COUNT         10
#define LED_BRIGHTNESS    64


// Define the input pin
#define BUTTON_PIN        10

// Define the delay length (aka speed; higher numbers are slower)
#define DELAY_LENGTH_RAINBOW      10
#define DELAY_LENGTH_BLUE         150
#define DELAY_LENGTH_PURPLE       50

// Define the number of times to repeat each pattern
#define CYCLE_MAX_RAINBOW         75
#define CYCLE_MAX_BLUE            10
#define CYCLE_MAX_PURPLE          10
#define CYCLE_MAX                 1474559   // 1,474,559 is the max possible value before the int rolls over into negatives and the comparison breaks.


#define DEBUG
//---------------------------

//---------------------------
// Globals
// Create the strip state machine
enum StateMachine { OFF, INIT_RAINBOW, RAINBOW, UPDATE_RAINBOW, INIT_BLUE, BLUE, UPDATE_BLUE, INIT_PURPLE, PURPLE, UPDATE_PURPLE, INIT_OFF };
StateMachine strip_state;

// Create the timer
unsigned long timer;

// Create the color index
int index;
// Create the cycle counter
int cycle_count;

// Create the debounce flag for the button
bool debounce;


// Create the strip
Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
//---------------------------

void setup() {
// Initialize and clear the strip
strip.begin();
strip.setBrightness(LED_BRIGHTNESS);
strip.clear();

// Set the state of the LED strip to INIT_RAINBOW
strip_state = INIT_RAINBOW;

// Set the rainbow index to 0
index = 0;

// Initialize the button
pinMode(BUTTON_PIN, INPUT_PULLUP);

// Initialize the debounce flag;
debounce = 0;

#ifdef DEBUG
//Init serial
Serial.begin(9600);
#endif
}

void loop() {
// Run the state machine
switch (strip_state) {
  //    State: INIT_OFF
  case INIT_OFF:
#ifdef DEBUG
    Serial.println("STATE: OFF");
#endif
    //    Turn all LEDs off
    strip.clear();
    strip.show();
    //    Set the state to OFF
    strip_state = OFF;

  //    State: OFF
  case OFF:
    break;

  //    State: INIT_RAINBOW
  case INIT_RAINBOW:
#ifdef DEBUG
    Serial.println("STATE: RAINBOW");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_RAINBOW;

    // Set the state to RAINBOW
    strip_state = RAINBOW;

  // State: RAINBOW
  case RAINBOW:
    // If timer has expired, update the effect
    if (millis() > timer) {
      strip_state = UPDATE_RAINBOW;
    }

    checkButton(BUTTON_PIN);

    if (cycle_count >= CYCLE_MAX_RAINBOW) {
      cycle_count = 0;
      index = index % 256;
      strip_state = INIT_BLUE;
    }

    break;

  case UPDATE_RAINBOW:

#ifdef DEBUG
    Serial.println("STATE: RAINBOW_UPDATE");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_RAINBOW;

#ifdef DEBUG
    Serial.print("Millis: ");
    Serial.print(millis());
    Serial.print("     Timer: ");
    Serial.print(timer);
    Serial.print("     Cycle: ");
    Serial.print(cycle_count);
    Serial.println();
#endif

    updateStrip(strip);

    strip_state = RAINBOW;

    break;

  //    State: INIT_BLUE
  case INIT_BLUE:
#ifdef DEBUG
    Serial.println("STATE: BLUE");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_BLUE;

    // Set the state to BLUE
    strip_state = BLUE;

  //    State: BLUE
  case BLUE:
    if (millis() > timer) {
      strip_state = UPDATE_BLUE;
    }

    checkButton(BUTTON_PIN);

    if (cycle_count >= CYCLE_MAX_BLUE) {
      cycle_count = 0;
      index = index % 256;
      strip_state = INIT_PURPLE;
    }

    break;

  case UPDATE_BLUE:

#ifdef DEBUG
    Serial.println("STATE: BLUE_UPDATE");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_BLUE;

#ifdef DEBUG
    Serial.print("Millis: ");
    Serial.print(millis());
    Serial.print("     Timer: ");
    Serial.print(timer);
    Serial.print("     Cycle: ");
    Serial.print(cycle_count);
    Serial.println();
#endif

    updateStrip(strip);

    strip_state = BLUE;

    break;

  //    State: INIT_PURPLE
  case INIT_PURPLE:
#ifdef DEBUG
    Serial.println("STATE: PURPLE");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_PURPLE;

    // Set the state to PURPLE
    strip_state = PURPLE;

  //    State: PURPLE
  case PURPLE:
    if (millis() > timer) {
      strip_state = UPDATE_PURPLE;
    }

    checkButton(BUTTON_PIN);

    if (cycle_count >= CYCLE_MAX_PURPLE) {
      cycle_count = 0;
      index = index % 256;
      strip_state = INIT_RAINBOW;
    }

    break;

  case UPDATE_PURPLE:

#ifdef DEBUG
    Serial.println("STATE: PURPLE_UPDATE");
#endif

    // Set timer
    timer = millis() + DELAY_LENGTH_PURPLE;

#ifdef DEBUG
    Serial.print("Millis: ");
    Serial.print(millis());
    Serial.print("     Timer: ");
    Serial.print(timer);
    Serial.print("     Cycle: ");
    Serial.print(cycle_count);
    Serial.println();
#endif

    updateStrip(strip);

    strip_state = PURPLE;

    break;

  //  Default State: Change to INIT_RAINBOW
  //    We should never end up here
  //    .."should"..
  default:
#ifdef DEBUG
    Serial.println("STATE: DEFAULT");
#endif
    strip_state = INIT_RAINBOW;
    break;
}
}

void checkButton(int _pin) {

//      Check if the debounce flag is still set
if ( debounce == 1 ) {
  // If so, check if button has been released
  if ( digitalRead(_pin) == HIGH ) {
    debounce = 0;
#ifdef DEBUG
    Serial.print("Button ");
    Serial.print(_pin);
    Serial.println(" released");
#endif
  }
} else {
  //    Check if button has been pressed
  if ( digitalRead(_pin) == LOW ) {
    //      If so, set the cycle_count to it's maximum value
    cycle_count = CYCLE_MAX;
    // Set the debounce flag
    debounce = 1;

#ifdef DEBUG
    Serial.print("Button ");
    Serial.print(_pin);
    Serial.println(" activated");
#endif
  }
}
}

void updateStrip(Adafruit_NeoPixel &_strip) {
index++;
// Check if the cycle has completed
if (index >= 256) {
  index = index % 256;
  cycle_count++;
}

//    Fill the strip with colors
for (int i = 0; i < LED_COUNT; i++) {
  //_strip.setPixelColor(i, Wheel(((i * 256 / _strip.numPixels()) + index) & 255) );
  _strip.setPixelColor(i, getColorByState(strip.numPixels(), strip_state, i) );
}
// Display effect
_strip.show();
}


uint32_t getColorByState(int _maxPixels, StateMachine _state, int _i) {
switch (_state) {
  case INIT_OFF:
  case OFF:
    return Adafruit_NeoPixel::Color(0, 0, 0);
    break;
  case INIT_RAINBOW:
  case RAINBOW:
  case UPDATE_RAINBOW:
    return Wheel(((_i * 256 / _maxPixels) + index) & 255);
    break;
  case INIT_BLUE:
  case BLUE:
  case UPDATE_BLUE:
    return Adafruit_NeoPixel::Color(index/3, 0, (((_i + index) * 256 / _maxPixels) & 255));
    break;
  case INIT_PURPLE:
  case PURPLE:
  case UPDATE_PURPLE:
    return Adafruit_NeoPixel::Color((((_i + index) * 256 / _maxPixels) & 255), 0, 0.65 * (((_i + index) * 256 / _maxPixels) & 255));
    break;
  default:
    return Adafruit_NeoPixel::Color(0, 0, 0);
    break;
}
}



// Color FX

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos)
{
WheelPos = 255 - WheelPos;
if (WheelPos < 85)
{
  return Adafruit_NeoPixel::Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
else if (WheelPos < 170)
{
  WheelPos -= 85;
  return Adafruit_NeoPixel::Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
else
{
  WheelPos -= 170;
  return Adafruit_NeoPixel::Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}

Well that was a fail in pasting....

I am trying to use one button to cycle between 4 different color pallette options for the neopixel strand in my Cosplay costume. I like the color apllete options in FASTLED, but am having trouble trying to get that to work with the state machine a FB fellow maker put together for me.
I wanted the button to be able to interrupt at anytime, and cycle between:

  1. Blue-Magenta color pallete fade
  2. Lava/Red
  3. Ocean
  4. Off

The Color Pallete example wouldnt paste in and stay within char parameters. It has a timer based cycle, and I'm ahving trouble finding how to work the two options together.
I kept getting an error in this section saying the FillLEds and Changeperiodically function error out when trying to work with the button, but not when i run the as is example

{
    ChangePalettePeriodically();
    
    static uint8_t startIndex = 0;
    startIndex = startIndex + 1; /* motion speed */
    
    FillLEDsFromPaletteColors( startIndex);

I couldnt find any tutorials or anyting on how to utilize the Color Pallette system in FASTLED, and just am too new to be able to decipher what parts of the example can be replaced or nested into a state machine

Well that was a fail in pasting....

Under your post on the right hand side there is a drop down menu that will allow you to edit your post and put it in code tags, to make it easy for everyone.