handleColorChanged method
Handles the color change event.
This method calls the onColorChanged callback with the provided newColor
and then calls handleUpdateUI.
Implementation
void handleColorChanged(int newColor) {
onColorChanged?.call(newColor);
handleUpdateUI();
}