Bug 56461 (rrggbbaa) - Add #RRGGBBAA and #RGBA as options for color hex values in CSS
Summary: Add #RRGGBBAA and #RGBA as options for color hex values in CSS
Status: RESOLVED DUPLICATE of bug 39140
Alias: rrggbbaa
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 06:27 PDT by Paul Neave
Modified: 2011-03-23 11:31 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Neave 2011-03-16 06:27:58 PDT
Currently the only way to specify a color with an alpha value is to use the rgba() syntax, such as:

.my-color {
    color: rgba(255, 255, 255, 0.5); /* half white */
}

This can become very unwieldy to write. A more succinct syntax could extend the current format of #rgb or #rrggbb to include #rgba or #rrggbbaa like so:

.my-color {
    color: #ffffff80; /* half white */
}

The browser could easily detect the difference between a 3 or 4 character hex value, or a 6 or 8 character hex value, and implement the alpha channel as appropriate.
Comment 1 Mike Lawther 2011-03-20 20:35:56 PDT
This is not in the spec.

Perhaps ask www-style@ for their opinion.
Comment 2 Andras Becsi 2011-03-23 11:31:55 PDT

*** This bug has been marked as a duplicate of bug 39140 ***