/** The luminance of the foreground color. */ static public final int getForegroundColorValue() { return Utils.luminance(Toolbar.getForegroundColor()); } }
public synchronized static void fill(int sx, int sy, int sz) { fill(IJ.getImage(), sx, sy, sz, Toolbar.getForegroundColor().getRGB()); }
public static void setBrushWidth(int width) { if (brushInstance!=null) { Color c = Toolbar.getForegroundColor(); brushInstance.setWidth(width); Toolbar.setForegroundColor(c); } }
public Arrow(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); setStrokeWidth(defaultWidth); style = defaultStyle; headSize = defaultHeadSize; doubleHeaded = defaultDoubleHeaded; outline = defaultOutline; setStrokeColor(Toolbar.getForegroundColor()); }
public static void setBrushWidth(int width) { if (brushInstance!=null) { Color c = Toolbar.getForegroundColor(); brushInstance.setWidth(width); Toolbar.setForegroundColor(c); } }
public Arrow(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); setStrokeWidth(defaultWidth); style = defaultStyle; headSize = defaultHeadSize; doubleHeaded = defaultDoubleHeaded; outline = defaultOutline; setStrokeColor(Toolbar.getForegroundColor()); }
void setForegroundColor(ImageProcessor ip) { if (defaultColor!=null) ip.setColor(defaultColor); else if (!Double.isNaN(defaultValue)) ip.setValue(defaultValue); else ip.setColor(Toolbar.getForegroundColor()); colorSet = true; }
void setForegroundColor(ImageProcessor ip) { if (defaultColor!=null) ip.setColor(defaultColor); else if (!Double.isNaN(defaultValue)) ip.setValue(defaultValue); else ip.setColor(Toolbar.getForegroundColor()); colorSet = true; }
/** * @deprecated * replaced by ImageProcessor.draw(Roi) */ public void draw(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); roi.drawPixels(ip); if (IJ.altKeyDown()) drawLabel(ip); }
/** * @deprecated * replaced by ImageProcessor.draw(Roi) */ public void draw(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); roi.drawPixels(ip); if (IJ.altKeyDown()) drawLabel(ip); }
void editColor() { Color c = background?Toolbar.getBackgroundColor():Toolbar.getForegroundColor(); ColorChooser cc = new ColorChooser((background?"Background":"Foreground")+" Color", c, false); c = cc.getColor(); if (background) Toolbar.setBackgroundColor(c); else Toolbar.setForegroundColor(c); }
@Override public void eventOccurred(final int eventID) { if (IJEventListener.FOREGROUND_COLOR_CHANGED == eventID) { if (this != front || null == active || !project.isInputEnabled()) return; selection.setColor(Toolbar.getForegroundColor()); Display.repaint(front.layer, selection.getBox(), 0); } else if (IJEventListener.TOOL_CHANGED == eventID) { Display.repaintToolbar(); } }
void editColor() { Color c = background?Toolbar.getBackgroundColor():Toolbar.getForegroundColor(); ColorChooser cc = new ColorChooser((background?"Background":"Foreground")+" Color", c, false); c = cc.getColor(); if (background) Toolbar.setBackgroundColor(c); else Toolbar.setForegroundColor(c); }
public void run(ImageProcessor ip) { Roi roi = image.getRoi(); if (roi == null || roi.getType() != roi.LINE) { IJ.error("Need a linear selection"); return; } Line line = (Line)roi; if (line.getLength() == 0) { IJ.error("Line too short"); return; } int from = Toolbar.getBackgroundColor().getRGB(); int to = Toolbar.getForegroundColor().getRGB(); makeLinearGradient(ip, from, to, line); image.updateAndDraw(); }
public void refreshForeground(boolean backgroundInFront) { //Boundary for Foreground Selection setColor(0x444444); drawRect(8, 266, (w*2)+4, (h*2)+4); setColor(0x999999); drawRect(9, 267, (w*2)+2, (h*2)+2); setRoi(10, 268, w*2, h*2); //Paints the Foreground Color Color fg = Toolbar.getForegroundColor(); setColor(fg); fill(); if (backgroundInFront) drawLabel("F", fg, 12, 268+14); }
/** * @deprecated * replaced by ImageProcessor.fill(Roi) */ public void fill(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); } else ip.fill(); // fill with foreground color }
public void refreshForeground(boolean backgroundInFront) { //Boundary for Foreground Selection setColor(0x444444); drawRect(8, 266, (w*2)+4, (h*2)+4); setColor(0x999999); drawRect(9, 267, (w*2)+2, (h*2)+2); setRoi(10, 268, w*2, h*2); //Paints the Foreground Color Color fg = Toolbar.getForegroundColor(); setColor(fg); fill(); if (backgroundInFront) drawLabel("F", fg, 12, 268+14); }
/** * @deprecated * replaced by ImageProcessor.fill(Roi) */ public void fill(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); } else ip.fill(); // fill with foreground color }
public void clear(ImageProcessor ip) { ip.setColor(Toolbar.getBackgroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(); } else if (roi!=null && roi instanceof TextRoi) ((TextRoi)roi).clear(ip); else ip.fill(); // fill with background color ip.setColor(Toolbar.getForegroundColor()); }
public void clear(ImageProcessor ip) { ip.setColor(Toolbar.getBackgroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(); } else if (roi!=null && roi instanceof TextRoi) ((TextRoi)roi).clear(ip); else ip.fill(); // fill with background color ip.setColor(Toolbar.getForegroundColor()); }