1. Technology

<input type="color">

By

INPUT Color Description:

The color INPUT tag gives you a way to request colors in your web form. The color type collects sRGB color with 8-bit red, green and blue components. Ideally, the browser would display a color well that allows the user to pick the exact color they want to submit.

DTD: HTML5: <!doctype html>

INPUT Color Web Browser Support:

At this time, no browser supports the INPUT color type with a color picker. Instead, they display a text box. You can still use this input type, you will just have to validate that the contents are a color with a script or CGI.

HTML Versions

INPUT Color Attributes:

Global attributes, event attributes, and the input tag attributes. Plus:

  • autocomplete
  • list

INPUT Color Usage:

Standard color input tag

<form>
<input type="color" value="rgb(128,0,0);">
</form>

See an example of a standard color input tag.

INPUT Color Special Notes:

The input color tag is not supported in any browsers if you want a color picker displayed, but you can still use this input type and validate that the submitted data is a color. That way, when browsers do start supporting it, your forms won't have to be modified.

More INPUT Color Information:

©2014 About.com. All rights reserved.