Hardcoding nodes and their colors like this is EXTREMELY ugly.  See how minetestmapper reads this from a file (although it's parser could use work).