Your preferences have been saved!
» Getting Number of Colors - import java.awt.DisplayMode; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; public class Main {   public static void main(String[] argv) throws Exception {     GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();     GraphicsDevice gs = ge.getDefaultScreenDevice();     DisplayMode[] dmodes = gs.getDisplayModes();     for (int i = 0; i < dmodes.length; i++) {       int refreshRate = dmodes[i].getRefreshRate();... 06 Feb 12 » Blend two colors - import java.awt.Color; /**  * @author Cameron Behar  */ public class ColorUtilities {   public static Color blend(Color c0, Color c1) {     double totalAlpha = c0.getAlpha() + c1.getAlpha();     double weight0 = c0.getAlpha() / totalAlpha;     double weight1 = c1.getAlpha() / totalAlpha;     double r = weight0 * c0.getRed() + weight1 * c1.getRed();... 05 Feb 12 » Utility class for managing resources such as colors, fonts, images, - import java.awt.Image; import java.awt.Toolkit; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Iterator; import javax.swing.ImageIcon;... 05 Feb 12 » Returns n-dimensional array of colors for given nx3 integer array - import java.awt.Color; public class Util {   /**    * Returns n-dimensional array of colors for given nx3 integer array of RGB values.     */   public static Color[] getColorScale(int[][] rgb) {     if (rgb == null)       return null;     Color[] clr = new Color[rgb.length];     for (int i = 0; i < rgb.length; i++) {... 05 Feb 12 » If the color is equal to one of the defined - import java.awt.Color; import java.lang.reflect.Field; import java.lang.reflect.Modifier; public class Main {   /**    * Converts a color into a string. If the color is equal to one of the defined    * constant colors, that name is returned instead. Otherwise the color is    * returned as hex-string.    *     * @param c... 05 Feb 12 » Map colors into names and vice versa. - import java.awt.Color; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; /**  * A helper class to map colors into names and vice versa.  *   * @author Thomas Morgner  */ public final class ColorUtilitiy {... 05 Feb 12