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

Method getGroupColor

ij/src/main/java/ij/gui/Roi.java:1932–1949  ·  view source on GitHub ↗

Retrieves color associated to a given roi group.

(int group)

Source from the content-addressed store, hash-verified

1930
1931 /** Retrieves color associated to a given roi group. */
1932 private static Color getGroupColor(int group) {
1933 Color color = ROIColor; // default ROI color
1934 if (group>0) { // read Glasbey Lut
1935 if (glasbeyLut==null) {
1936 String path = IJ.getDir("luts")+"Glasbey.lut";
1937 glasbeyLut = LutLoader.openLut("noerror:"+path);
1938 if (glasbeyLut==null) {
1939 path = IJ.getDir("luts")+"glasbey.lut";
1940 glasbeyLut = LutLoader.openLut("noerror:"+path);
1941 }
1942 if (glasbeyLut==null)
1943 IJ.log("LUT not found: "+path);
1944 }
1945 if (glasbeyLut!=null)
1946 color = new Color(glasbeyLut.getRGB(group));
1947 }
1948 return color;
1949 }
1950
1951 /** Returns the angle in degrees between the specified line and a horizontal line. */
1952 public double getAngle(int x1, int y1, int x2, int y2) {

Callers 2

setDefaultGroupMethod · 0.95
setGroupMethod · 0.95

Calls 4

getDirMethod · 0.95
openLutMethod · 0.95
logMethod · 0.95
getRGBMethod · 0.80

Tested by

no test coverage detected