W3C home > Mailing lists > Public > www-style@w3.org > May 2013

Re: [css-color] Have you considered standardizing a rgba(#RRGGBB, <alpha-value>) notation?

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 10 May 2013 10:57:48 -0700
Message-Id: <D057F429-8D63-415E-A543-522F8AF21ACA@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Sebastian Zartner <sebastianzartner@gmail.com>, François REMY <francois.remy.dev@outlook.com>, Lea Verou <lea@w3.org>, Jake Archibald <jaffathecake@gmail.com>, Šime Vidas <sime.vidas@gmail.com>, www-style list <www-style@w3.org>
To: Sam L'ecuyer <sam@cateches.is>
On May 10, 2013, at 10:11 AM, "Sam L'ecuyer" <sam@cateches.is> wrote:

> 
>> I don't get it. If you have to include the color inside the that you are going to modify, that is a considerable shortcoming. I'd much rather have it as this:
> 
>> color: #ff4500; color-adjust(saturation - 20%);
>> background-color: orangered; color-adjust(luminance 50%, background-color, box-shadow, border-color);
> 
> Should that be `color: #ff4500, color-adjust(saturation - 20%);`?  A ; doesn't make sense to me there.

No, the 'color' property would be declared normally, as would 'border-color' (or the shorthand), 'background-color'  (or the shorthand), 'text-shadow', 'box-shadow', etc. The semicolon separates declarations, as usual. 'color-adjust' would be a separate property, so I did mess up writing that. I should have written this:

.foo {
   color: #ff4500; 
   color-adjust: saturation - 20%;
}
.bar {
   background-color: orangered; 
   color-adjust: luminance 50%;
   background-color, box-shadow, border-color;
}

The list following the percentage in the second example would be the properties to apply the adjustment to (if omitted, would apply to all properties that use <color>). So the following two examples would be equivalent, aside from stacking context differences:

.foo {
   color-adjust: alpha 20%;
}
.foo {
   opacity: 0.2;
}

An alternative syntax would be to have an "all" keyword that could substitute for a list of properties, and have 'color' be the default property affected, if the list of properties or 'all' was omitted. 
Received on Friday, 10 May 2013 18:05:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:29 UTC