/** * Returns a color from white-green-red-blue according to the degree of <tt>vertex</tt>. * * @param vertex a vertex */ @Override public Color getColor(Object vertex) { int val = ((Vertex) vertex).getEdges().size(); double color = 0; if (logscale) { double min2 = Math.log(k_min + 1); double max2 = Math.log(k_max + 1); color = (Math.log(val + 1) - min2) / (max2 - min2); } else { color = (val - k_min) / (double) (k_max - k_min); } return ColorUtils.getGRBColor(color); }