class Colors {

    public static Paint getColor(Attributed attributed) {
		Map<String, String> map = attributed.getAttributeMap();
        // if there is a 'VertexType' attribute key, use its value to choose a predefined color
		if (map.containsKey("VertexType")) {
			String typeValue = map.get("VertexType");
            return VERTEX_TYPE_TO_COLOR_MAP.getOrDefault(typeValue, Color.blue);
         }
        // if there is an 'EdgeType' attribute key, use its value to choose a predefined color
		if (map.containsKey("EdgeType")) {
			String typeValue = map.get("EdgeType");
            return EDGE_TYPE_TO_COLOR_MAP.getOrDefault(typeValue, Color.green);
        }
        // if there is a 'Color' attribute key, use its value (either a color name or an RGB hex string)
        // to choose a color
		if (map.containsKey("Color")) {
			String colorName = map.get("Color");
            if (WEB_COLOR_MAP.containsKey(colorName)) {
                return WEB_COLOR_MAP.get(colorName);
			}
			// if the value matches an RGB hex string, turn that into a color
			Color c = getHexColor(colorName);
			if (c != null) {
				return c;
			}
        }
        // default value when nothing else matches
        return Color.green;
    }

    private  Colors();

}