Walter White Is Green in HTML

What has “Walter White” got to do with actual colours and HTML?

Breaking Bad is a bit of a hot topic at the moment (I’m a fan myself) but you’re probably thinking where on earth is he going with this, “Walter White” isn’t a valid colour. Let me explain before you think I’ve gone mad.

Example

Walter White snippet
1
<font color="Walter White">Walter White</font>

The above code snippet will actually colour the text “Walter White”, in a Breaking Bad green, automatically.

Don’t believe me? Here’s a live demo. Apologies for the use of a font tag.

What is going on here?!

It does seem crazy but fortunately there is some science behind it :)

The cooking process

  1. Replace all invalid hexadecimal characters with “0”
  2. Divide all hexadecimal characters into 3 even groups (pad if necessary)
  3. Take the first 2 hexadecimal characters from each group

Et voilà!

No? Let’s step through the example.

  1. “Walter White” becomes “0a00e000000e” when replacing invalid hexadecimal characters with “0”
  2. “0a00e000000e” is 12 characters long, so dividing into 3 groups gives “0a00 e000 000e”
  3. Taking the first 2 hexadecimal characters from each group in “0a00 e000 000e” produces “0a e0 00”

“Walter White” = “#0ae000”

I would have expected it to be blue, but I’m guessing the process isn’t 100% pure :)