()
| 874 | } |
| 875 | |
| 876 | void setColor() { |
| 877 | interp.getLeftParen(); |
| 878 | if (isStringArg()) { |
| 879 | globalColor = getColor(); |
| 880 | globalValue = Double.NaN; |
| 881 | ImagePlus imp = WindowManager.getCurrentImage(); |
| 882 | if (imp!=null) { |
| 883 | if (overlayPath!=null) |
| 884 | addDrawingToOverlay(imp); |
| 885 | getProcessor().setColor(globalColor); |
| 886 | getProcessor().fillColorSet(true); |
| 887 | } |
| 888 | interp.getRightParen(); |
| 889 | return; |
| 890 | } |
| 891 | double arg1 = interp.getExpression(); |
| 892 | if (interp.nextToken()==')') { |
| 893 | interp.getRightParen(); |
| 894 | setColor(arg1); |
| 895 | return; |
| 896 | } |
| 897 | int red=(int)arg1, green=(int)getNextArg(), blue=(int)getLastArg(); |
| 898 | if (red<0) red=0; if (green<0) green=0; if (blue<0) blue=0; |
| 899 | if (red>255) red=255; if (green>255) green=255; if (blue>255) blue=255; |
| 900 | globalColor = new Color(red, green, blue); |
| 901 | globalValue = Double.NaN; |
| 902 | if (WindowManager.getCurrentImage()!=null) { |
| 903 | getProcessor().setColor(globalColor); |
| 904 | getProcessor().fillColorSet(true); |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | void setColor(double value) { |
| 909 | ImageProcessor ip = getProcessor(); |
no test coverage detected