W3C home > Mailing lists > Public > www-style@w3.org > June 2008

[Fwd: RE: [css3-color] RGBA Hex Notation]

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 2 Jun 2008 17:28:09 -0700
To: www-style@w3.org
Message-ID: <20080603002809.GA32490@pickering.dbaron.org>
These three messages were sent to www-style a number of weeks ago,
but didn't show up in the archives; I presume Bert never moderated
them through to the list.

(My responses to them did show up on the list, though.)

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

attached mail follows:


> -----Original Message-----
> From: L. David Baron [mailto:dbaron@dbaron.org] 
> Sent: Monday, May 12, 2008 7:41 PM
> To: Mikko Rantalainen; W. Leon Sutton, Jr.; fantasai; Adam Kuehn
> Cc: www-style@w3.org
> Subject: Re: [css3-color] RGBA Hex Notation
> 
> On Thursday 2004-09-09 16:56 +0300, Mikko Rantalainen wrote:
> > Ian Hickson wrote:
> >> On Thu, 2 Sep 2004, Brian Hunger wrote:
> >>> alpha!
> >>
> >> http://www.w3.org/TR/css3-color/#rgba-color
> >> Already supported by Safari.
> >
> > Why not support #1234 and #12345678 formats too? The RGB 
> color syntax 
> > already supports #123 and #123456  
> > <URL:http://www.w3.org/TR/css3-color/#rgb-color>. A new 
> syntax with 4 or 
> > 8 digits wouldn't collide with the old mechanism, instead 
> it would be a 
> > logical extension.
> >
> > For example, #7777 would be 50% transparent 50% grey, #f004 
> would be  
> > ~25% opaque red etc. The short forms would be expanded just 
> like RGB  
> > values: double the digits. The above examples would be equal to  
> > #77777777 and #ff000044 or rgba(127,127,127,127) and 
> rgba(255,0,0,68)
> 
> The working group discussed the addition of new features to
> css3-color and decided that no new features should be added at this
> time; rather, the draft should be advanced with its current feature
> set, which is at this point widely implemented.  New features will
> be considered for the next level of the CSS color module.
> 
> If you are not satisfied with this response, please let us know
> within two weeks, if possible.
> 
> -David

Personally, I think this is a mistake.

First, it isn't really the addition of a full-blown "feature".  RGBA is
already the specified feature.  This suggestion adds only a notational
convention to access the feature.

Second, the reason for making the addition is clear: By far the most popular
notational form for color in use on actual web pages at present is
hexadecimal.  You will get much broader user acceptance of the spec if you
support a reasonable extension of this format for RGBA.  I would suggest
that a hex notation format for RGBA at least be specified, even if it is
indicated as optional for implementers.  At least that would standardize the
target notation for future use.

Finally, implementation of a hex notation, whatever the agreed format,
should be completely trivial.  Parsers are just not that hard to write when
the input format is clearly specified and inflexible.  The code for
producing the actual color is already there for use, as you just explained
("current feature set...is...widely implemented").

Personally, I would use #XXX-A and #XXXXXX-A for the format, but it doesn't
really matter as long as it is reasonable to users and is standardized.  A
little work now can make a difficult spec just that much easier for web
developers to internalize.

Respectfully submitted,

-Adam Kuehn

> 
> On Thursday 2004-09-09 21:17 -0400, W. Leon Sutton, Jr. wrote (in
> response to the previous quoted message):
> > Yes, the RGB-A color format would be a great addition.  
> There are many uses
> > for such that I can think of.
> 
> On Friday 2004-09-10 10:39 -0400, Adam Kuehn wrote (in response to
> the previous quoted message):
> > Let's be clear that rgba color *format* is already in the 
> CSS 3 Color  
> > Module CR draft.  The current draft includes rgba (xxx, xxx, xxx,  
> > <alpha>) and rgba (xxx%,xxx%, xxx%, <alpha>) as the only 
> two available 
> > notational forms to express that color format.  My 
> suggestion is to add a 
> > hex notation form to those already proposed. E.g. color: 
> #xxx<alpha> and 
> > color: #xxxxxx<alpha> - either with or without a delimiter 
> before the 
> > <alpha> portion.  The reason for the suggestion is to 
> preserve the most 
> > common color notation format presently in use in CSS when 
> used for alpha 
> > colors.  In my view, it is worth the effort to make the use of the 
> > property as easy for current and future authors as possible.
> 
> -- 
> L. David Baron                                 http://dbaron.org/
> Mozilla Corporation                       http://www.mozilla.com/
> 

attached mail follows:


David Baron wrote: 

> I really don't see how you can say it's not a feature.  A new syntax
> for the same thing is a feature.

It's irrelevant how we define "feature".  The point is, the hard part
(displaying the colors) has already been implemented.  All that remains is
parsing the new syntax.  Heck, even most of the parsing code already exists.
This is easy.

> It would still delay the spec
> advancing to recommendation, since there are not two interoperable
> implementations of the feature.

IMO it is worth a delay to ensure consistent implementation of something
that would make life easier for actual web developers.  

> It's not trivial to ship that in already-released browsers.

It is as trivial to ship that as it is to ship ANY change to an
already-released browser.  This is very much near the bottom of the
implementation difficulty scale.

In my view, this is really a philosophical question.  Is the spec leading,
or following?  If it is leading, this is a change worth making.  If it is
just following (cataloging what exists), then it isn't.

-Adam Kuehn

attached mail follows:


David Baron wrote:

> The leading should be left to the next release of
> the specification.

Which is when?  What is the next time the W3C would take the lead?

My point on this particular modification is the same as it was nearly four
years ago: This is easy, why not put it in?  It could be implemented in a
matter of days.  If the suggestion had been adopted when it was proposed in
September of 2004 (when the color module was a CR, but still a relatively
new concept), it would surely have been implemented by two or more
developers by now.  Every single web browser of any consequence has had a
major release (most of them have had two), since this suggestion was
advanced.

Given the history, the meanings of the various stages of the specification,
and the status of most of the other CSS3 modules, I don't think including
this syntax would cause a delay that would have any practical negative
impact.  Moreover, it at least has a chance of making the spec more useful.

If the decision is already taken, then so be it, but I still think the WG
should reconsider.

-Adam Kuehn
Received on Tuesday, 3 June 2008 00:28:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:07 GMT