W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2011

[whatwg] Please reconsider: Set restricted palette for input type=color

From: Markus Ernst <derernst@gmx.ch>
Date: Tue, 08 Mar 2011 10:51:47 +0100
Message-ID: <4D75FC33.5040908@gmx.ch>
Am 07.03.2011 18:27 schrieb Markus Ernst:
> Reading on the "Color" state of the input element, I miss a
> possibility how to define a set of allowed colors. For other states of
> the input element there are such possibilities, such as setting min, max
> and step attributes for input type=date.
> As UAs are encouraged to provide a user interface, such as a color
> picker, there should be a way to define a limited set of colors to be
> included in the picker.
> Use case:
> A content management or blog system for a corporate website allows to
> set font and background colors. The designers define allowed color sets
> the way that the corporate design guidelines are respected, and that the
> text is always readable - e.g. three light color shades for backgrounds,
> and two corporate colors and black for text.
> Possible solution:
> Slightly strengthen the impact of the list attribute for this input
> type. If there is a suggestion source element with one or more valid
> colors, color pickers are required to only display the colors specified
> there.

Searching for implementations of input type=color, I found that Opera 
actually implemented the color picker quite similar to my suggestion. If 
there is a suggestion source element, Opera displays a color palette 
with the colors listed there, and an "Other..." button that leads to the 
detailled color picker.

I personnally would like a possibility to hide the "Other..." button, 
but this is not really a need. Opera's behaviour makes it possible to 
provide a consistent validation message, saying something like: "Please 
choose one of the suggested colors. Sorry, other colors are not allowed 

Is it possible to spec Opera's behaviour as a standard for color picking 
Received on Tuesday, 8 March 2011 01:51:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:31 UTC