private void loadHashMap() {
		// load from a file formatted like this:
		// #HEX color
		// e.g #FFFFFF white
		File colorMap = new File("colormap.txt");
		try {
			BufferedReader in = new BufferedReader(new FileReader(colorMap));
			while (in.ready()) {
				String line = in.readLine();
				// make sure it matches the format
				if (line.matches("#[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]?[a-fA-F0-9]?[a-fA-F0-9]?\\s\\w+")) {
					int spacePos = line.indexOf('\t');
					if (spacePos == -1) {
						spacePos = line.indexOf(' '); // has used a space instead of tab
					}
					if (spacePos != -1) {
//						System.out.println(line.substring(0, spacePos) + "=" + line.substring(spacePos+1));
						hexToColors.put(line.substring(0, spacePos), line.substring(spacePos + 1));
					}
				}
			}
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}