def rgb(red, green, blue):
for value in (red, green, blue):<EOL><INDENT>if value not in range(<NUM_LIT:6>):<EOL><INDENT>raise ColorError('<STR_LIT>'.format(value))<EOL><DEDENT><DEDENT>return <NUM_LIT:16> + (red * <NUM_LIT>) + (green * <NUM_LIT:6>) + blue<EOL>
Calculate the palette index of a color in the 6x6x6 color cube.

The red, green and blue arguments may range from 0 to 5.