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

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

From: (wrong string) Γριφεγ <grfgguvf@gmail.com>
Date: Wed, 24 Sep 2008 10:03:13 +0000
Message-ID: <8413367b0809231817r73cf3f98y8dfe33c1f2f5f355@mail.gmail.com>
To: www-style@w3.org




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:

..HILITE {
  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%),
50%)));
 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 GMT

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