W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-color-4] Renaming gray()

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 23 Jul 2014 15:15:05 -0700
Message-ID: <CAAWBYDBgW6s6D6ZgodaaoB_6rjM82Fy87RWYCdUhZcj4vJDSDg@mail.gmail.com>
To: Kornel Lesiński <kornel@geekhood.net>
Cc: www-style list <www-style@w3.org>, Lea Verou <lea@verou.me>
On Wed, Jul 23, 2014 at 2:53 PM, Kornel Lesiński <kornel@geekhood.net> wrote:
> +1 for white().
>
>
> 1. Cocoa's equivalent is colorWithWhite:alpha:
>
> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSColor_Class/Reference/Reference.html#//apple_ref/occ/clm/NSColor/colorWithWhite:alpha:
>
> I've checked popular answers on stackoverflow that include references to
> variants of this function: developers seem to be using it properly, and I
> haven't seen anybody confused about it.

Interesting.

> 2. CSS is tied more closely to RGB than CMYK
>
> If there was black(x) I'd expect it to be a shorthand for cmyk(0,0,0,x), but
> use of actual CMYK colors in CSS can be a can of worms (it should be subject
> to color profiles, but then black(0) may be different than rgb(0,0,0)).
>
> However in the RGB world white(x) can be simply explained as rgb(255*x,
> 255*x, 255*x), but the same doesn't make sense for black: rgb(0*x, 0*x,
> 0*x).

Black is just (100% - x) for each component.

~TJ
Received on Wednesday, 23 July 2014 22:15:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC