[whatwg] Allow empty string for input type=color

Ashley Sheridan ash at ashleysheridan.co.uk
Thu May 3 11:37:48 PDT 2012


On Fri, 2012-05-04 at 04:33 +1000, Shaun Moss wrote:

> The way things are done is not always the best way. Most colour pickers 
> are used in instances where "not selected" would make no sense.
> 
> However, as you're designing a widget for the web that may be used by 
> billions of people in any number of unforeseen ways, flexibility is a 
> virtue, and the option to clear the field would be an improvement. If 
> you don't allow a "not selected" or null option, this would basically 
> force all colour widgets to be required fields, which may not be what 
> the form designer wants.
> 
> To compare, some date pickers do not allow you to clear the field, but 
> some do. For the web, it's a useful feature.
> 
> Shaun
> 
> 
> On 2012-05-03 11:46 PM, Anne van Kesteren wrote:
> > On Thu, 03 May 2012 02:10:11 -0700, Markus Ernst <derernst at gmx.ch> wrote:
> >> If I understand the spec correctly, entering no value defaults to 
> >> #000000, thus the required attribute does not apply. What are the 
> >> reasons for this? I am sure there were good reasons to specify it 
> >> this way, anyway I don't see them right now. "Not selected" is 
> >> actually very different from "black".
> >
> > "Not selected" is not something typically supported by native color 
> > pickers.
> >
> >
> 


Would the colour pickers allow the selection of the alpha channel at the
time of choosing? If so, couldn't you allow a full transparent colour to
be used where null couldn't?
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk





More information about the whatwg mailing list