changeColor method

void changeColor(
  1. int index
)

Change bulb color based on partition index

Implementation

void changeColor(int index) {
  if (index < _colors.length) {
    _colorIndex = index;
    notifyListeners();
  }
}