def gray(value):
if value not in range(<NUM_LIT>):<EOL><INDENT>raise ColorError('<STR_LIT>'.format(value))<EOL><DEDENT>return <NUM_LIT> + value<EOL>
Calculate the palette index of a color in the grayscale ramp.

The value argument may range from 0 to 23.