Re: HTML 3.2 PR color value syntax

Chris Lilley (chris@w3.org)
Wed, 13 Nov 1996 15:13:52 +0100


To: www-html@w3.org
From: Chris Lilley <chris@w3.org>
Subject: Re: HTML 3.2 PR color value syntax
Date: Wed, 13 Nov 1996 15:13:52 +0100
Message-ID: <3289D7A0.1CFB@w3.org>
To: "Chris Wilson (PSD)" <cwilso@MICROSOFT.com>

Chris Wilson (PSD) wrote:
> 
> I'm a bit surprised no one has piped up with this yet: the Cascading
> Style Sheets draft has a syntax for specifying colors in decimal. 

Right


> * hexadecimal notation - "#ff007f" or "#f07".  Extending this to > 8bits
> per color is not mentioned, but neither is it explicitly disallowed (in
> my opinion, anyway)

I seem to recall that it is explicitly mentioned and also explicitly
illustrated. The rule is to extend by replication. So your example of 
#f07becomes #ff0077 or fff000777 or ffff00007777. This rule ensures 
that it is always possible to get zero intensity and full intensity
and that the intervening values are evenly spaced (in RGB).

> * RGB functional notation: "rgb( 255, 0 , 0)" (RGB triplet, integer
> ranges 0-255) AND "rgb( 100%, 0%, 0%)" (float range 0.0% - 100.0%).

 This is certainly the preferred way, and I hope MSIE x where x>3.0 
supports this syntax.

> It should be trivial for any browser that supports these notations in
> CSS (which is required to conform to CSS 1.0 - which IE3.0 doesn't) to
> implement them in HTML attributes as well, and shouldn't conflict with
> anything, especially since as someone noted, the COLOR attribute is
> CDATA.

Right, and that might be a useful option in the future; although by 
then hopefully people will have stopped hard-coding colors onto each
individual element in each individual document that uses them.

> I noted a couple of people mentioned other color models - perhaps
> HSV/HSL models could be represented in a similar manner, e.g.
> "hsv(100%,75%,75%)".  I'm not enough of a color whiz to propose the
> exact semantics of that myself, but it could certainly fit in the CSS
> color mechanism simply as another functional notation.

Provided the semantics of those color models were defined. HSV, HSI, 
HSL do not get you anywhere valuable, and CMYK is a non-starter as far 
as portable documents are concerned.

Personally, I would rather select colors using an eyedropper tool, but 
there we are. The user interface and the textual representation are
independent aspects.

-- 
Chris Lilley, W3C                          [ http://www.w3.org/ ]
Graphics and Fonts Guy            The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)4 93 65 79 87       06902 Sophia Antipolis Cedex, France