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

Method getRoiColor

ij/src/main/java/ij/macro/Functions.java:8245–8263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8243 */
8244
8245 private Color getRoiColor() {
8246 interp.getLeftParen();
8247 if (isStringArg()) {
8248 Color color = Colors.decode(getString(),null);
8249 interp.getRightParen();
8250 return color;
8251 } else {
8252 int r = (int)interp.getExpression();
8253 if (interp.nextToken()==')') {
8254 interp.getRightParen();
8255 return new Color(r);
8256 }
8257 int g = (int)getNextArg();
8258 int b = (int)getLastArg();
8259 if (r<0) r=0; if (g<0) g=0; if (b<0) b=0;
8260 if (r>255) r=255; if (g>255) g=255; if (b>255) b=255;
8261 return new Color(r, g, b);
8262 }
8263 }
8264
8265 private void getContainedPoints(Roi roi) {
8266 Variable xCoordinates = getFirstArrayVariable();

Callers 1

doRoiMethod · 0.95

Calls 9

isStringArgMethod · 0.95
decodeMethod · 0.95
getStringMethod · 0.95
getNextArgMethod · 0.95
getLastArgMethod · 0.95
getLeftParenMethod · 0.80
getRightParenMethod · 0.80
getExpressionMethod · 0.80
nextTokenMethod · 0.45

Tested by

no test coverage detected