[Proposal] CSS: Access to system colors, also, color filters

It ought to be possible to make sites which fit in with the system
color theme, let alone remaining legible with a light-on-dark theme.

One color theme does not fit all, Blue-and-black-on-white sometimes
does get tiring.

Currently the problem is twofold. Sites either specify colors
explicitly, in which case they might look out-of-place, or don't
specify some colors, in which case the system default color is used.
When it's not the expected black/white, things break.

I propose access to system default colors and simple color filters in
CSS such as in the example that follows:

  background-color: invert(background);
  foreground-color: invert(foreground);

Proposed special colors - default to value from system theme:
* background
* foreground
* selection-background
* selection-foreground
* ...more?

Proposed color filters:
* invert(color)
* tint(original, ink, percentage) /* Can sometimes be poorly emulated
with opacity... */
* brightness([color,] percent)
* hue([color, ]shift value probably 0-255)
* saturation(color, percent)
* ...

This would make things like the following possible:

..menuitem:hover {
  background: gradient(linear, top left, bottom right, color-stop(0%,
brightness(invert(selection-background), 150%)), color-stop(15%,
selection-background), color-stop(85%, selection-background),
color-stop(100%, saturation(brightness(selection-background, 20%),
 foreground-color: selection-foreground;

If any or all of this is already part of CSS, please pardon my ignorance.

Received on Wednesday, 8 October 2008 08:07:00 UTC