practicebasic
Color picker
A color picker with a preset palette and a custom color input. Shows the selected color in a preview swatch and its hex value.
Objectives
- 1.Declare selectedColor state with initial value
#3b82f6 - 2.On click: update selectedColor with the clicked color
- 3.Highlight the selected color in the palette
- 4.Wire up the input type=
colorto pick a custom color - 5.Show the selected color in the preview swatch and its hex value
your code
Hint
Use input type='color' for the custom color picker.
Related concepts
Was this helpful?
Sign in to give feedback
