Re: [css4-color] #RGBA

Brian Manthos:
> If you add a "non-functional" syntax to RGB, and don't add it to HSL that suggests that HSL isn't worthy of spending the time to provide a tight non-functional syntax so that it has parity with RGB.

The hash notation, “non-functional” as you call it, is a relict, invented by programmers for computers, not for people. It is very opaque as to which color it may yield. Adding the alpha channel is just a matter of consistency.

Since HSL, unlike RGB and CMYK, is not about how devices think about colors, but more about how people do, you shouldn’t want, if any, a more computeresque notation for it, but a more humane one. Some have been discussed here as long ago as 2002, e.g. <http://lists.w3.org/Archives/Public/www-style/2002May/0201.html> or CNS.

  <color>      := [ saturation || lightness || transparency ]? hue
  modifier     := ‘extra’ | ‘semi’
  saturation   := [ modifier ‘-’ ]? [ ‘dull’ | ‘bright’] | [ duller | brighter ]
  lightness    := [ modifier ‘-’ ]? [ ‘dark’ | ‘light’]  | [ darker | lighter ]
  transparency := [ ‘semi-’ ]? [ ‘opaque’ | ‘transparent’ ]
  hue          := prime | general | special
  prime        := ‘red’ | ‘yellow’ | ‘green’ | ‘cyan’ | ‘blue’ | ‘magenta’
                | ‘black’ | ‘white’
  general      := ‘navy’ | ‘lime’ | ‘teal’ | ‘aqua’ | ‘maroon’ | ‘purple’
                | ‘fuchsia’ | ‘olive’ | ‘gray’ | ‘silver’
  special      := ‘pink’ | ‘brown’ | ‘tan’ | ‘orange’ | ‘yellow-green’
                | ‘green-cyan’ | ‘cyan-blue’ | ‘blue-magenta’ | ‘magenta-red’ … 

CNS <http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1674223>
(Influenced by ISCC-NBS, but not using shorthands ‘brilliant’, ‘pale’, ‘deep’ for S/L combinations and some hue names, leveraging restrictions.)

  <color>      := chromatic | achromatic
  chromatic    := lightness saturation hue | [saturation]? [lightness]? hue
  saturation   := ‘grayish’ | ‘moderate’ | ‘strong’ | _‘vivid’_
  lightness    := ‘very dark’ | ‘dark’ | _‘medium’_ | ‘light’ | ‘very light’
  hue          := generic | halfway | quarterway
                = [ primary ‘-’ ]? primary | secondary primary
  generic      := primary
  halfway      := primary ‘-’ primary  # only adjacent, order irrelevant
  quarterway   := secondary primary    # only adjacent
  primary      := ‘red’ | [‘orange’ | ‘brown’] | ‘yellow’ | ‘green’
                | ‘blue’ | ‘purple’
  secondary    := ‘reddish’ | [‘orangish’ | ‘brownish’] | ‘yellowish’ 
                | ‘greenish’ | ‘bluish’
  achromatic   := ‘black’ | [ lightness ]? ‘gray’ | ‘white’

<http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1420399> is similar but makes some changes:

  lightness    |= ‘blackish’ | ‘whitish’
  saturation   |= ‘medium’
  primary      |= ‘pink’ | ‘beige’ | ‘olive’
  secondary    |= ‘purplish’ | ‘pinkish’
  achromatic   := [ lightness ]? [ secondary ]? a-primary
  a-primary    := ‘black’ | ‘gray’ | ‘white’

> So with the CSS4 change, RGB is now two steps ahead of HSL -- it has rgb(), rgba(), #rrggbb, and #rrggbbaa whereas HSL only has hsl() and hsla().

Actually rgb() counts as two, because it supports 8bit integers and percentages.

Received on Friday, 10 September 2010 22:16:32 UTC