/** Sets the color ("blue", "black", etc.) of the font used to label outlines in the next particle analyzer instance. */ public static void setFontColor(String color) { nextFontColor = Colors.decode(color, defaultFontColor); }
/** Sets the color ("blue", "black", etc.) of the font used to label outlines in the next particle analyzer instance. */ public static void setFontColor(String color) { nextFontColor = Colors.decode(color, defaultFontColor); }
public static int getBlue(String hexColor) { return decode(hexColor, Color.black).getBlue(); }
public static int getRed(String hexColor) { return decode(hexColor, Color.black).getRed(); }
public static int getGreen(String hexColor) { return decode(hexColor, Color.black).getGreen(); }
public static int getRed(String hexColor) { return decode(hexColor, Color.black).getRed(); }
public static int getGreen(String hexColor) { return decode(hexColor, Color.black).getGreen(); }
public static int getBlue(String hexColor) { return decode(hexColor, Color.black).getBlue(); }
protected static Color getColor(String colorName) { if (colorName == null) colorName = "none"; Color color = null; color = Colors.getColor(colorName, color); if (color == null) color = Colors.decode(colorName, color); return color; }
/** Set the plot frame background color. */ public void setBackgroundColor(String c) { setBackgroundColor(Colors.decode(c,Color.white)); }
/** Set the plot frame background color. */ public void setBackgroundColor(String c) { setBackgroundColor(Colors.decode(c,Color.white)); }
public void setColor(String color) { setColor(Colors.decode(color, Color.black)); }
public void setColor(String color) { setColor(Colors.decode(color, Color.black)); }
void setPlotObjectStyle(PlotObject plotObject, String styleString) { String[] items = styleString.split(","); int nItems = items.length; if (items[nItems-1].indexOf("hidden") >= 0) { plotObject.setFlag(PlotObject.HIDDEN); nItems = items.length - 1; } else plotObject.unsetFlag(PlotObject.HIDDEN); plotObject.color = Colors.decode(items[0].trim(), plotObject.color); plotObject.color2 = Colors.decode(items[1].trim(), null); float lineWidth = plotObject.lineWidth; if (items.length >= 3) try { plotObject.lineWidth = Float.parseFloat(items[2].trim()); } catch (NumberFormatException e) {}; if (items.length >= 4 && plotObject.shape!=CUSTOM) plotObject.shape = toShape(items[3].trim()); updateImage(); return; }
/** Adds the current selection to the ROI Manager, using the specified color (a 6 digit hex string) and line width. */ public boolean runCommand(String cmd, String hexColor, double lineWidth) { if (hexColor==null && lineWidth==1.0 && (IJ.altKeyDown()&&!Interpreter.isBatchMode())) addRoi(true); else { Color color = hexColor!=null?Colors.decode(hexColor, Color.cyan):null; addRoi(null, false, color, (int)Math.round(lineWidth)); } return true; }
/** Adds the current selection to the ROI Manager, using the specified color (a 6 digit hex string) and line width. */ public boolean runCommand(String cmd, String hexColor, double lineWidth) { if (hexColor==null && lineWidth==1.0 && (IJ.altKeyDown()&&!Interpreter.isBatchMode())) addRoi(true); else { Color color = hexColor!=null?Colors.decode(hexColor, Color.cyan):null; addRoi(null, false, color, (int)Math.round(lineWidth)); } return true; }
private Color getRoiColor() { interp.getLeftParen(); if (isStringArg()) { Color color = Colors.decode(getString(),null); interp.getRightParen(); return color; } else { int r = (int)interp.getExpression(); if (interp.nextToken()==')') { interp.getRightParen(); return new Color(r); } int g = (int)getNextArg(); int b = (int)getLastArg(); if (r<0) r=0; if (g<0) g=0; if (b<0) b=0; if (r>255) r=255; if (g>255) g=255; if (b>255) b=255; return new Color(r, g, b); } }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (e!=null && e.toString().contains("Undo")) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) IJ.run("Undo"); return true; } width = (int)gd.getNextNumber(); if (gd.invalidNumber() || width<0) width = (int)Prefs.get(widthKey, 1); //transparency = (int)gd.getNextNumber(); //if (gd.invalidNumber() || transparency<0 || transparency>100) // transparency = 100; String colorName = gd.getNextChoice(); paintOnOverlay = gd.getNextBoolean(); Color color = Colors.decode(colorName, null); Toolbar.setForegroundColor(color); Prefs.set(widthKey, width); Prefs.set(OVERLAY_KEY, paintOnOverlay); return true; } }