News for hackers. Stuff that matters.
Re:#c0ffee is the color by vmarquet on Monday June 12, 2017 @12:43PM (#14538663)
I'm surprised no one yet has mentionned the famous stack overflow question: https://stackoverflow.com/questions/8318911/why-does-html-th....

TLDR; For legacy reasons, some words produce valid colors even if they don't respect the standard color formats. For example, "chucknorris" produces red.

Re:#c0ffee is the color by eriknstr on Monday June 12, 2017 @03:44PM (#14540405)
Someone should make a list of all words and common phrases that result in a color different from #000000 and then go through them all and pick out the interesting ones.

By the way I didn't see any mention of max length. Is there a limitiation to the length of the color string?

Bonus question: What color would the complete works of Shakespeare be? Take all of his scene play manuscripts found on Project Gutenberg but excluding duplicates if any, sort them in the order they were originally published and concatenate into a single string.

Re:#c0ffee is the color by ubernostrum on Monday June 12, 2017 @05:29PM (#14541282)
The HTML5 color parsing algorithm is less complex than it seems. Mostly it boils down to "take any characters that aren't hex digits and replace them with zeroes, then truncate the resulting string in a consistent way to produce a 24-bit value".