Renamed restoreState to saveState for clarity. Extracted transferState function to perform common state operations. Added state transfer for color pickers.