Build this React exercise in 25 minutes.
Build a 12-preset color picker and custom hex input. Start at #3b82f6. Accept exactly #RGB or #RRGGBB, case-insensitively, normalize committed colors to lowercase six-digit hex, and preserve raw partial input. Do not trim or accept named colors. Invalid input keeps the last valid preview.
Acceptance checks
- Clicking any preset synchronizes preview, input, text, pressed state, and selection marker.
- Typing #F00 commits #ff0000 and selects its matching preset; raw input stays #F00.
- Typing #, #12, #xyz, or an empty string keeps the last valid color and shows an associated error.
- All 12 controls and the input work by keyboard; a text marker and aria-pressed identify the selected preset.
The checks are a manual interview checklist; saving a submission does not execute them.
Learn and continue
Prerequisite: Controlled inputs. Work through the React Machine Coding Foundations path to practice related skills in order.