/** * @param plotter * @return */ public static Color getUniqueColor( IRegion.RegionType type, IRegionSystem plotter, Collection<Color> colours) { final Collection<Color> used = new HashSet<Color>(7); for (IRegion reg : plotter.getRegions()) { if (reg.getRegionType() != type) continue; used.add(reg.getRegionColor()); } for (Color color : colours) { if (!used.contains(color)) return color; } return colours.iterator().next(); }