@Override public void actionPerformed(final ActionEvent e) { applyColortoSelectPaths(ij.plugin.Colors.getColor(e.getActionCommand(), SimpleNeuriteTracer.DEFAULT_DESELECTED_COLOR)); } });
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; }
private void setOptions(String options) { if (options==null) return; if (options.contains("tiny")) size=TINY; else if (options.contains("medium")) size=MEDIUM; else if (options.contains("extra")) size=EXTRA_LARGE; else if (options.contains("large")) size=LARGE; if (options.contains("cross")) type=CROSS; else if (options.contains("dot")) type=DOT; else if (options.contains("circle")) type=CIRCLE; setStrokeColor(Colors.getColor(options,Roi.getColor())); addToOverlay = options.contains("add"); }
private void setOptions(String options) { if (options==null) return; if (options.contains("tiny")) size=TINY; else if (options.contains("medium")) size=MEDIUM; else if (options.contains("extra")) size=EXTRA_LARGE; else if (options.contains("large")) size=LARGE; if (options.contains("cross")) type=CROSS; else if (options.contains("dot")) type=DOT; else if (options.contains("circle")) type=CIRCLE; setStrokeColor(Colors.getColor(options,Roi.getColor())); addToOverlay = options.contains("add"); }
public static Color decode(String hexColor, Color defaultColor) { Color color = getColor(hexColor, null); if (color==null) { if (hexColor.startsWith("#")) hexColor = hexColor.substring(1); int len = hexColor.length(); if (!(len==6 || len==8)) return defaultColor; float alpha = len==8?parseHex(hexColor.substring(0,2)):1f; if (len==8) hexColor = hexColor.substring(2); float red = parseHex(hexColor.substring(0,2)); float green = parseHex(hexColor.substring(2,4)); float blue = parseHex(hexColor.substring(4,6)); color = new Color(red, green, blue, alpha); } return color; }
public static Color decode(String hexColor, Color defaultColor) { Color color = getColor(hexColor, null); if (color==null) { if (hexColor.startsWith("#")) hexColor = hexColor.substring(1); int len = hexColor.length(); if (!(len==6 || len==8)) return defaultColor; float alpha = len==8?parseHex(hexColor.substring(0,2)):1f; if (len==8) hexColor = hexColor.substring(2); float red = parseHex(hexColor.substring(0,2)); float green = parseHex(hexColor.substring(2,4)); float blue = parseHex(hexColor.substring(4,6)); color = new Color(red, green, blue, alpha); } return color; }
public void itemStateChanged(ItemEvent e) { Choice choice = (Choice)e.getSource(); String item = choice.getSelectedItem(); Color color = getColor(item, Color.black); if (choice==fchoice) Toolbar.setForegroundColor(color); else if (choice==bchoice) Toolbar.setBackgroundColor(color); else if (choice==schoice) { Roi.setColor(color); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.getRoi()!=null) imp.draw(); Toolbar.getInstance().repaint(); } }
public void itemStateChanged(ItemEvent e) { Choice choice = (Choice)e.getSource(); String item = choice.getSelectedItem(); Color color = getColor(item, Color.black); if (choice==fchoice) Toolbar.setForegroundColor(color); else if (choice==bchoice) Toolbar.setBackgroundColor(color); else if (choice==schoice) { Roi.setColor(color); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.getRoi()!=null) imp.draw(); Toolbar.getInstance().repaint(); } }
overlay.drawNames(showNames); overlay.drawBackgrounds(drawBackgrounds); Color color = Colors.getColor(colorName, Color.white); overlay.setLabelColor(color); if (sizeChanged || bold || bold!=bold2)
overlay.drawNames(showNames); overlay.drawBackgrounds(drawBackgrounds); Color color = Colors.getColor(colorName, Color.white); overlay.setLabelColor(color); if (sizeChanged || bold || bold!=bold2)
roi.setStrokeColor(Colors.getColor(color,Color.cyan)); if (bold && linesV*linesH<5000) { ImageCanvas ic = imp.getCanvas();
roi.setStrokeColor(Colors.getColor(color,Color.cyan)); if (bold && linesV*linesH<5000) { ImageCanvas ic = imp.getCanvas();
Color sc = Colors.getColor(selectionColor, Color.yellow); if (sc!=Roi.getColor()) { Roi.setColor(sc);
Color sc = Colors.getColor(selectionColor, Color.yellow); if (sc!=Roi.getColor()) { Roi.setColor(sc);