Extended shorthand for hex colours

Hexadecimal notation is commonly used for defining colours in CSS, but the shorthand is lacking. Right now we can use #CCC which would be expanded to #CCCCCC, but that's pretty much it.

Wouldn't it be nice if we built upon the principles of the existing shorthand -- repeating the defined characters -- to provide more options?

For example:

1. #C expands to #CCCCCC
2. #C3 expands to #C3C3C3
3. #CCC expands to #CCCCCC

These two extra shorthand formats would allow a lot of hex colours to be typed and/or transmitted across networks more efficiently.

I don't think it'd make sense to allow for four- or five-character shorthand, as the defined characters could not be repeated in full.

Kind regards,

--
Ryan Williams

Received on Thursday, 22 January 2015 13:49:45 UTC