HTML: input type="color"
A color input lets users choose a color and submits the selected value as a color string such as #336699.
What you will learn
- How to label a color picker
- How to read and submit its value
- Why contrast and non-color cues still matter
Minimal example
<label for="accent">Accent color</label>
<input id="accent" name="accent" type="color" value="#336699">The picker UI varies by browser and operating system. The form value is data, so validate it before using it to build styles or store it.
Common mistakes
- Do not rely on color alone to communicate status or meaning; add text or another visual cue.
- Check text and background contrast after applying a user-selected color.
- Keep a visible label and explain the purpose of the color choice.