Hacker News new | ask | show | jobs
by colmvp 3566 days ago
Regarding the example in the Wiki page: Is it possible to use hex colors codes or rgb color codes? The example uses color name.
2 comments

It is indeed!

     Color
          causes the affected text to be displayed in a specified
          color. The "color" command requires a parameter that is
          specified by using the "param" command. The parameter
          data can be one of the following:

               red
               blue
               green
               yellow
               cyan
               magenta
               black
               white

          or an RGB color value in the form:

               ####,####,####

          where '#' is a hexadecimal digit '0' through '9', 'A'
          through 'F', or 'a' through 'f'. The three 4-digit
          hexadecimal values are the RGB values for red, green, and
          blue respectively, where each component is expressed as
          an unsigned value between 0 (0000) and 65535 (FFFF). The
          default color for the message is unspecified, though
          black is a common choice in many environments. When
          nested, the inner "color" command takes precedence.
(https://tools.ietf.org/html/rfc1896#page-5)

Odd that it's 96bpp colour, of all things.

In fact, you have even more options, not just two:

1) RGB: #rrggbb (rgb hex) / rgb(r,g,b) (rgb int 0-255) / rgba(r,g,b,a) (as before, plus alpha). In addition, rgb/rgba support percentage values instead of 0-255.

2) red (color names)

3) hsl(h,s,l)

4) cmyk(c,m,y,k)

For compatibility with anything except Thunderbird (which supports all four formats IIRC), stick with #rrggbb or plaintext names. Webmailers are especially prone to filtering by regex (ugh), and stripping out everything they don't know.

I'm not seeing that on the text/enriched spec? You might be thinking of HTML email.