What colour is this? Given three number values - being the Red, Green, and Blue elements of a colour (eight bits per channel, 0 to 255) - your program must output the name of the given colour.

For example; 

Input:  255, 0, 0  
Output: Red


or;

Input:  80, 0, 0
Output: Dark Red


This is a popularity contest, so whichever answer has the most votes by the first of July wins.

Ispired by: Show the input RGB color
Python

This is a Python script that uses the results from xkcd's Color Survey, in which Randall Munroe asked thousands of people the exact same question. He arrived at the following chart:



The survey only has data on fully-saturated colors (I guess non-saturated colors would all be described as 'grayish'). This means we have to do some color-related tricks to force our input to become fully saturated. 

What I've done here is just convert the input color to HSV, crank up the saturation, and call it a day. This is probably not very correct from a color perception point of view, but it works well enough here - and it's simple enough that you only need the standard library. Batteries included indeed.

The script expects satfaces.txt, from here (mirror), to be in the current directory.

import sys, colorsys

n = (int(sys.argv[1], 16))
r = ((n &amp; 0xff0000) &gt;&gt; 16) / 255.0
g = ((n &amp; 0x00ff00) &gt;&gt; 8) / 255.0
b = ((n &amp; 0x0000ff)) / 255.0

(h, s, v) = colorsys.rgb_to_hsv(r, g, b)
(r, g, b) = colorsys.hsv_to_rgb(h, 1, v)

match = "[{}, {}, {}]".format(int(r*255), int(g*255), int(b*255))

for line in open("satfaces.txt"):
    if line.startswith(match):
        print("You were thinking of: " + line.split("] ")[1].strip())
        break


Some example runs:

$ python color.py CEB301
You were thinking of: yellow
$ python color.py CC9900
You were thinking of: orange
$ python color.py CC0000
You were thinking of: red
$ python color.py 0077FF
You were thinking of: blue


And here are the colors:






I'd say that's pretty close.