After looking at the ws2812fx library more I think the following will work:
#include <WS2812FX.h>
#define LED_PIN 6 // digital pin used to drive the LED strip
#define LED_COUNT 240 // number of LEDs on the strip
const int buttonPin = 2;
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(115200);
ws2812fx.init();
ws2812fx.setBrightness(128);
ws2812fx.setIdleSegment(0, 0, 9, FX_MODE_BLINK, 0xFF0000, 1000, false); // segment 0 is leds 0 - 9
ws2812fx.setIdleSegment(1, 10, 19, FX_MODE_SCAN, 0x00FF00, 1000, false); // segment 1 is leds 10 - 19
}
void loop() {
static bool blinkFlag = true;
static int lastButtonState = digitalRead(buttonPin);
int currButtonState = digitalRead(buttonPin);
if (currButtonState != lastButtonState)
{
delay(50); // debounce
lastButtonState = currButtonState;
if (currButtonState == LOW)
{
if (blinkFlag)
{
blinkFlag = false;
ws2812fx.stop();
ws2812fx.removeActiveSegment(1);
ws2812fx.addActiveSegment(0);
ws2812fx.start();
}
else
{
blinkFlag = true;
ws2812fx.stop();
ws2812fx.removeActiveSegment(0);
ws2812fx.addActiveSegment(1);
ws2812fx.start();
}
}
}
ws2812fx.service();
}