static int NameToCode (string s)
{
switch (s) {
case "black":
return 0;
case "red":
return 1;
case "green":
return 2;
case "yellow":
return 3;
case "blue":
return 4;
case "magenta":
return 5;
case "cyan":
return 6;
case "grey":
case "white":
return 7;
}
return 7;
}