Bug 56461 (rrggbbaa)

Summary: Add #RRGGBBAA and #RGBA as options for color hex values in CSS
Product: WebKit Reporter: Paul Neave <paul.neave>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Enhancement CC: abecsi, mikelawther
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Paul Neave
Reported 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.
Attachments
Mike Lawther
Comment 1 2011-03-20 20:35:56 PDT
This is not in the spec. Perhaps ask www-style@ for their opinion.
Andras Becsi
Comment 2 2011-03-23 11:31:55 PDT
*** This bug has been marked as a duplicate of bug 39140 ***
Note You need to log in before you can comment on or make changes to this bug.