Get i-th color
@param {number} color number
@returns {Object} color
347684
function getColor (i) {
    i = parseInt(i);
    if (i < 0 || i >= colors.length) {
      // pick a color from the scale defined above
      return scale(((i - colors.length) * (211 / 971)) % 1);
    } else {
      return chroma(colors[i]);
    }
  }
715237
protected String colorString(int ir, int ig, int ib)
    {
    	return String.format("#%02x%02x%02x", ir, ig, ib);
    }
397809
public static int toRGB(String color) {
		validateHexSingle(color);
		if (color.length() == 1) {
			color += color;
		}
		return Integer.parseInt(color, 16);
	}
110333
function(color){
		for( var i=0, l= this.colors.length; i<l; i++){
			if( this.colors[i].equals( color ) ){
				return true;
			}
		}
		return false;
	}
869549
def _get_color(self, r, g, b):
        
        clr = (r, g, b)
        return clr
365141
def color(self, color):
        
        if color == RGB_WHITE:
            self.white()
            return
        self._color = color
        self.hue = hue_of_color(color)
402396
def color(self):
        """"""
        color = idc.GetColor(self.ea, idc.CIC_FUNC)
        if color == 0xFFFFFFFF:
            return None

        return color
1243376
function getColorStr(color) {
    var hex = color.hexString();
    var alpha = getAlphaHex(color.alpha());
    var colorStr = '#' + alpha + hex.slice(1);

    return colorStr.toLowerCase();
}
572172
function (color) {
            return (
                (this.glArray[0] === color.glArray[0]) &&
                (this.glArray[1] === color.glArray[1]) &&
                (this.glArray[2] === color.glArray[2]) &&
                (this.glArray[3] === color.glArray[3])
            );
        }
81325
def get_edge_color(self, increment=1):
        

        i = self.edge_colors_index

        self.edge_colors_index += increment
        if self.edge_colors_index >= len(self.edge_colors):
            self.edge_colors_index = self.edge_colors_index-len(self.edge_colors)
            if self.edge_colors_index >= len(self.edge_colors): self.edge_colors_index=0 # to be safe

        return self.edge_colors[i]
36459
function _retrieveColor(palette, color, hue = '500', format) {
    if (typeof palette !== 'string' || typeof color !== 'string' || typeof hue !== 'string' || typeof format !== 'string') {
        throw new TypeError('Expected a string');
    }

    let hexColor;
    let result;

    try {
        hexColor = (palette === 'md') ? colors[palette][color][hue].hex : colors[palette][color];

        switch (format) {
            case 'rgb':
                result = _toRGB(hexColor);
                result = `rgb(${result.r}, ${result.g}, ${result.b})`;
                break;
            case 'hex':
                result = `#${hexColor}`;
                break;
            case 'raw':
                result = _toRGB(hexColor);
                result.hex = hexColor;
                break;
            default:
        }
    } catch (err) {
        throw new RangeError('No matching color.');
    }
    return result;
}
771854
function ( color ) {
            var colorObj = this.toRgb( color, true );
            return ( (colorObj.r * 299) + (colorObj.g * 587) + (colorObj.b * 114) ) / 1000;
        }
868115
def get_color_indices(color)   # :nodoc:
    invalid = 0x7FFF   # return from Colors#get_color when color is invalid

    index = Colors.new.get_color(color)
    index = invalid if color.respond_to?(:coerce) && (color < 8 || color > 63)
    if index == invalid
      [nil, nil]
    else
      [index, get_color_rbg(index)]
    end
  end
850590
public static Color valueOf(String color) {

    Objects.requireNonNull(color, "color");
    Throwable cause = null;
    try {
      Color hexColor = parseHexString(color);
      if (hexColor != null) {
        return hexColor;
      } else {
        String upperColor = BasicHelper.toUpperCase(color);
        Color namedColor = NAME_TO_COLOR_MAP.get(upperColor);
        if (namedColor != null) {
          return namedColor;
        } else if (upperColor.startsWith(ColorModel.RGB.toString())) {
          Color rgbColor = parseRgb(upperColor);
          if (rgbColor != null) {
            return rgbColor;
          }
        } else {
          return GenericColor.valueOf(color).toColor();
        }
      }
    } catch (NumberFormatException e) {
      cause = e;
    }
    throw new IllegalArgumentException(color, cause);
  }
1237190
function getColorGroups(colors) {
  var colorGroups = [];

  colors.forEach(function (color) {
    if (colorGroups.indexOf(color.group) < 0) {
      colorGroups.push(color.group);
    }
  });

  return colorGroups;
}
218188
def get_color(color = nil) # :nodoc:
    if color.respond_to?(:to_int) && color.respond_to?(:+)
      # the default color if arg is outside range,
      if color < 0 || 63 < color
        0x7FFF
      # or an index < 8 mapped into the correct range,
      elsif color < 8
        (color + 8).to_i
      # or an integer in the valid range
      else
        color.to_i
      end
    elsif color.respond_to?(:to_sym)
      color = color.downcase.to_sym if color.respond_to?(:to_str)
      # or the color string converted to an integer,
      if COLORS.has_key?(color)
        COLORS[color]
      # or the default color if string is unrecognised,
      else
        0x7FFF
      end
    else
      0x7FFF
    end
  end
990702
function ( color ) {
		var digits, red, green, blue, result, i, nth;

		if ( color.charAt( 0 ) === "#" ) {
		    result = color;
		}
		else {
			digits = string.explode( color.replace( /.*\(|\)/g, "" ) );
			red    = number.parse( digits[0] || 0 );
			green  = number.parse( digits[1] || 0 );
			blue   = number.parse( digits[2] || 0 );
			result = ( blue | ( green << 8 ) | ( red << 16 ) ).toString( 16 );

			if ( result.length < 6 ) {
				nth = number.diff( result.length, 6 );
				i   = -1;

				while ( ++i < nth ) {
					result = "0" + result;
				}
			}

			result = "#" + result;
		}

		return result;
	}