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

Method setColor

ij/src/main/java/ij/IJ.java:1759–1768  ·  view source on GitHub ↗
(int red, int green, int blue, boolean foreground)

Source from the content-addressed store, hash-verified

1757 }
1758
1759 static void setColor(int red, int green, int blue, boolean foreground) {
1760 Color c = Colors.toColor(red, green, blue);
1761 if (foreground) {
1762 Toolbar.setForegroundColor(c);
1763 ImagePlus img = WindowManager.getCurrentImage();
1764 if (img!=null)
1765 img.getProcessor().setColor(c);
1766 } else
1767 Toolbar.setBackgroundColor(c);
1768 }
1769
1770 /** Switches to the specified tool, where id = Toolbar.RECTANGLE (0),
1771 Toolbar.OVAL (1), etc. */

Callers 2

setForegroundColorMethod · 0.95
setBackgroundColorMethod · 0.95

Calls 6

toColorMethod · 0.95
setForegroundColorMethod · 0.95
getCurrentImageMethod · 0.95
getProcessorMethod · 0.95
setBackgroundColorMethod · 0.95
setColorMethod · 0.65

Tested by

no test coverage detected