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

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