views:

40

answers:

3

It is best practice to stick with HEX colors when designing HTML emails - does it matter?

+3  A: 

HEX are RGB colors.

Developer Art
+2  A: 

If you are talking about color: #010203 vs color: rgb(1,2,3) in CSS, it doesn't make any difference. But some HTML mail clients will not allow you to use arbitrary CSS anyway.

When colors are specified in the HTML itself (eg. <table bgcolor>), only the #010203 format is allowed. Specifying colours in HTML is a vile horror that only really still exists because HTML mail is so fundamentally broken.

bobince
+1  A: 

Assuming you're referring to the declaration format rgb(x,y,z); I believe that's a 2.1 feature and since browser support for that is incomplete *cough*IE*cough* I would recommend avoiding it for email clients which in general are considerably further behind the curve than browsers to put it mildly.

annakata
`rgb()` is CSS1 and supported everywhere CSS is (though that may not include mail). Are you thinking of `rgba()` (with alpha channel) the CSS3 extension which IE doesn't support until IE9?
bobince
Actually no, I was going by the quickref on webdevout - should have looked at the spec. Either way though, rgb is only partially supported on IE<8 an OP<9 and I wouldn't trust email clients for a second especially since realistically that means outlook. rgba is obviously right out :)
annakata
`rgb()` is absolutely safe on all clients that support CSS. Webdevout is only complaining that browsers don't reject all possible invalid constructs, to which the simple answer would seem to be “don't write invalid CSS”...
bobince
That's kind of missing the point - those browsers might be on the right side of liberal-accept, *but they still get it wrong*. If *they* get it wrong in a highly competitive and adaptive market an email has zero chance.
annakata