Returns an RGB tuple of the form {@code "x,x,x"} for the supplied
{@link FunctionEnum}. Defaults to gray; RGB {@code "150,150,150"}.

@param fe {@link FunctionEnum}
@return Non-null {@link String}
329751
public static String color(FunctionEnum fe) {
        if (fe == null) {
            return DFLT_NODE_COLOR;
        }
        switch (fe) {
        case ABUNDANCE:
            return "40,255,85";
        case BIOLOGICAL_PROCESS:
            return "255,51,102";
        case CATALYTIC_ACTIVITY:
            return "100,100,255";
        case CELL_SECRETION:
            return "204,204,255";
        case CELL_SURFACE_EXPRESSION:
            return "204,204,255";
        case CHAPERONE_ACTIVITY:
            return "100,100,255";
        case COMPLEX_ABUNDANCE:
            return "102,153,255";
        case COMPOSITE_ABUNDANCE:
            return "222,255,255";
        case DEGRADATION:
            return "255,51,102";
        case GENE_ABUNDANCE:
            return "204,255,204";
        case GTP_BOUND_ACTIVITY:
            return "100,100,255";
        case KINASE_ACTIVITY:
            return "100,100,255";
        case MICRORNA_ABUNDANCE:
            return "0,255,150";
        case MOLECULAR_ACTIVITY:
            return "100,100,255";
        case PATHOLOGY:
            return "255,51,102";
        case PEPTIDASE_ACTIVITY:
            return "100,100,255";
        case PHOSPHATASE_ACTIVITY:
            return "100,100,255";
        case PROTEIN_ABUNDANCE:
            return "85,255,255";
        case REACTION:
            return "255,51,102";
        case RIBOSYLATION_ACTIVITY:
            return "100,100,255";
        case RNA_ABUNDANCE:
            return "40,255,85";
        case TRANSCRIPTIONAL_ACTIVITY:
            return "100,100,255";
        case TRANSPORT_ACTIVITY:
            return "100,100,255";
        }
        return DFLT_NODE_COLOR;
    }
381442
public static void float2rgbe(byte[] rgbe, float red, float green, float blue) {
        float v;
        int e;

        v = red;
        if (green > v) {
            v = green;
        }
        if (blue > v) {
            v = blue;
        }
        if (v < 1e-32f) {
            rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0;
        }
        else {
            FracExp fe = frexp(v);
            v = (float) (fe.getFraction() * 256.0 / v);
            rgbe[0] = (byte) (red * v);
            rgbe[1] = (byte) (green * v);
            rgbe[2] = (byte) (blue * v);
            rgbe[3] = (byte) (fe.getExponent() + 128);
        }
    }
1338079
function rgb2html(r, g, b){
    if(r.length) { b = r[2], g = r[1], r = r[0]; }
    var s = '#' +
      Number(0x1000000+r*255*0x10000+g*255*0x100+b*255).toString(16).substring(1);
    return s;
}
745069
static double getColor( Expression param, CssFormatter formatter ) throws LessException {
        switch( param.getDataType( formatter ) ) {
            case Expression.COLOR:
            case Expression.RGBA:
                return param.doubleValue( formatter );
        }
        throw new LessException( "Not a color: " + param );
    }
595758
public static int filterColor(int color, Filter filter) {
        if (filter == Filter.NONE) {
            return color;
        }
        int a = color >>> 24;
        int r = (color >> 16) & 0xFF;
        int g = (color >> 8) & 0xFF;
        int b = color & 0xFF;
        switch (filter) {
            case GRAYSCALE:
                r = g = b = (int) (0.213f * r + 0.715f * g + 0.072f * b);
                break;
            case GRAYSCALE_INVERT:
                r = g = b = 255 - (int) (0.213f * r + 0.715f * g + 0.072f * b);
                break;
            case INVERT:
                r = 255 - r;
                g = 255 - g;
                b = 255 - b;
                break;
        }
        return (a << 24) | (r << 16) | (g << 8) | b;
    }
500236
def rgb(color,default=(0,0,0)):
    
    c = color.lower()
    if c[0:1] == '#' and len(c)==7:
        r,g,b = c[1:3], c[3:5], c[5:]
        r,g,b = [int(n, 16) for n in (r, g, b)]
        return (r,g,b)

    if c.find(' ')>-1:    c = c.replace(' ','')
    if c.find('gray')>-1: c = c.replace('gray','grey')
    if c in x11_colors.keys():  return x11_colors[c]
    return default
1147263
public static int color(ColorHolder colorHolder, Context ctx, @AttrRes int colorStyle, @ColorRes int colorDefault) {
        if (colorHolder == null) {
            return UIUtils.getThemeColorFromAttrOrRes(ctx, colorStyle, colorDefault);
        } else {
            return colorHolder.color(ctx, colorStyle, colorDefault);
        }
    }
923202
function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
1127109
public static int getColor(GraphicFactory graphicFactory, String colorString, ThemeCallback themeCallback, RenderInstruction origin) {
        if (colorString.isEmpty() || colorString.charAt(0) != '#') {
            throw new IllegalArgumentException(UNSUPPORTED_COLOR_FORMAT + colorString);
        } else if (colorString.length() == 7) {
            return getColor(graphicFactory, colorString, 255, 1, themeCallback, origin);
        } else if (colorString.length() == 9) {
            return getColor(graphicFactory, colorString, Integer.parseInt(colorString.substring(1, 3), 16), 3, themeCallback, origin);
        } else {
            throw new IllegalArgumentException(UNSUPPORTED_COLOR_FORMAT + colorString);
        }
    }
1299530
@Pure
	@SuppressWarnings("checkstyle:magicnumber")
	public static String toColor(int rgba) {
		final String code = ColorNames.getColorNameFromValue(rgba);
		if (!Strings.isNullOrEmpty(code)) {
			return code;
		}
		final StringBuilder s = new StringBuilder("#"); //$NON-NLS-1$
		s.append(Integer.toHexString(rgba));
		while (s.length() < 7) {
			s.insert(1, '0');
		}
		return s.toString();
	}
312958
public Color getFromString(final String hexValue) {
        final String hv = hexValue.toLowerCase(Locale.US);
        Color color = this.colorByHexValue.get(hv);
        if (color == null) {
            color = new Color() {
                @Override
                public String hexValue() {
                    return hv;
                }
            };
            this.colorByHexValue.put(hv, color);
        }
        return color;
    }
1016115
public String sprintf(double x)
      throws IllegalArgumentException {
    Enumeration e = vFmt.elements();
    ConversionSpecification cs = null;
    char c = 0;
    StringBuffer sb=new StringBuffer();
    while (e.hasMoreElements()) {
      cs = (ConversionSpecification)
        e.nextElement();
      c = cs.getConversionCharacter();
      if (c=='\0') sb.append(cs.getLiteral());
      else if (c=='%') sb.append("%");
      else sb.append(cs.internalsprintf(x));
    }
    return sb.toString();
  }
412188
private double doubleValue2Colors( double left, double right ) {
        return rgba( doubleValue( red( left ), red( right ) ), //
                        doubleValue( green( left ), green( right ) ), //
                        doubleValue( blue( left ), blue( right ) ), 1 );
    }
653586
public static GenericColor valueOf(String color) {

    Objects.requireNonNull(color, "color");
    Color namedColor = Color.fromName(color);
    if (namedColor != null) {
      return valueOf(namedColor);
    }
    int length = color.length();
    Throwable cause = null;
    try {
      // "#RRGGBB" / #AARRGGBB
      Color hexColor = Color.parseHexString(color);
      if (hexColor != null) {
        return valueOf(hexColor);
      }
      // "rgb(1,1,1)" = 10
      if (length >= 7) {
        String model = BasicHelper.toUpperCase(color.substring(0, 3));
        ColorModel colorModel = ColorModel.valueOf(model);
        int index = 3;
        boolean hasAlpha = false;
        char c = Character.toLowerCase(color.charAt(index));
        if (c == 'a') {
          hasAlpha = true;
          index++;
          c = color.charAt(index);
        }
        if (c == '(') {
          index++;
          int endIndex = color.indexOf(',', index);
          if (endIndex > 0) {
            String firstSegment = color.substring(index, endIndex).trim();
            index = endIndex + 1;
            endIndex = color.indexOf(',', index);
            if (endIndex > 0) {
              String secondSegment = color.substring(index, endIndex).trim();
              index = endIndex + 1;
              if (hasAlpha) {
                endIndex = color.indexOf(',', index);
              } else {
                endIndex = length - 1;
              }
              if (endIndex > 0) {
                String thirdSegment = color.substring(index, endIndex).trim();
                Alpha alpha;
                if (hasAlpha) {
                  alpha = new Alpha(color.substring(endIndex + 1, length - 1));
                } else {
                  alpha = Alpha.OPAQUE;
                }
                switch (colorModel) {
                  case RGB:
                    return valueOf(new Red(firstSegment), new Green(secondSegment), new Blue(thirdSegment), alpha);
                  case HSL:
                    return valueOf(new Hue(firstSegment), new Saturation(secondSegment), new Lightness(thirdSegment), alpha);
                  case HSV:
                  case HSB:
                    return valueOf(new Hue(firstSegment), new Saturation(secondSegment), new Brightness(thirdSegment), alpha);
                  default :
                    throw new IllegalStateException("" + colorModel);
                }
              }
            }
          }
        }
      }
    } catch (RuntimeException e) {
      cause = e;
    }
    throw new IllegalArgumentException(color, cause);
  }
1303381
function Color(value) {
    this.r = 0;
    this.g = 0;
    this.b = 0;
    this.a = null;
    var result = this.fromArray(value) ||
        this.namedColor(value) ||
        this.rgb(value) ||
        this.rgba(value) ||
        this.hex6(value) ||
        this.hex3(value);
}
1047214
public static GenericColorChannelTransformation fromFunction(Function<Double, Double> fn){
		Objects.requireNonNull(fn);
		return fromFunctions(fn, fn, fn, fn);
	}
1070729
public FourColors getCommonInteriorColors(CommonControlState type) {
        switch (type) {

        case DISABLED:
            return interiorDisabled;

        case DISABLED_SELECTED:
            return interiorDisabledSelected;

        case ENABLED:
            return interiorEnabled;

        case PRESSED:
            return interiorPressed;

        case DEFAULT:
            return interiorDefault;

        case DEFAULT_PRESSED:
            return interiorDefaultPressed;

        case SELECTED:
            return interiorSelected;

        case PRESSED_SELECTED:
            return interiorPressedSelected;
        }

        return null;
    }