MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setForegroundColor

Method setForegroundColor

ij/src/main/java/ij/gui/Toolbar.java:967–985  ·  view source on GitHub ↗
(Color c)

Source from the content-addressed store, hash-verified

965 }
966
967 public static void setForegroundColor(Color c) {
968 if (c==null)
969 return;
970 foregroundColor = c;
971 foregroundValue = Double.NaN;
972 IJ.notifyEventListeners(IJEventListener.FOREGROUND_COLOR_CHANGED);
973 if (instance==null)
974 return;
975 repaintTool(DROPPER);
976 for (int i=CUSTOM1; i<=instance.getNumTools()-2; i++) {
977 if (instance.icons[i]!=null && instance.icons[i].contains("C123"))
978 repaintTool(i); // some of this tool's icon is drawn in the foreground color
979 }
980 ColorPicker.update();
981 if (!IJ.isMacro()) setRoiColor(c);
982 ImagePlus imp = WindowManager.getCurrentImage();
983 if (imp!=null)
984 imp.getProcessor().fillColorSet(false);
985 }
986
987 public static Color getBackgroundColor() {
988 return backgroundColor;

Callers 15

setColorMethod · 0.95
restoreSettingsMethod · 0.95
dialogItemChangedMethod · 0.95
showDialogMethod · 0.95
itemStateChangedMethod · 0.95
dialogItemChangedMethod · 0.95
mousePressedMethod · 0.95
setDrawingColorMethod · 0.95
editColorMethod · 0.95
dialogItemChangedMethod · 0.95
setBrushWidthMethod · 0.95

Calls 10

notifyEventListenersMethod · 0.95
repaintToolMethod · 0.95
updateMethod · 0.95
isMacroMethod · 0.95
setRoiColorMethod · 0.95
getCurrentImageMethod · 0.95
getProcessorMethod · 0.95
getNumToolsMethod · 0.80
fillColorSetMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected