Returns the index of a specific color.

@param color
The color, whose index should be returned, as an {@link Integer} value
@return The index of the given color or -1, if the adapter does not contain the color
422681
public final int indexOf(@ColorInt final int color) {
        for (int i = 0; i < colorPalette.length; i++) {
            if (colorPalette[i] == color) {
                return i;
            }
        }

        return -1;
    }
1318648
public Integer getInteger (int index) {
        Long value = getLong (index);
        return (value != null) ? value.intValue () : null;
    }
1172399
@Override
    public Integer getInteger(int index) {
        indexCheck();
        return rows.get(row).getInteger(index);
    }
920109
Index getIndex(String indexName) {

        Index[] indexes = indexList;
        int     i       = getIndexIndex(indexName);

        return i == -1 ? null
                       : indexes[i];
    }
115276
def get_color(self, value):
        
        if value in COLOR_SET:
            value = COLOR_MAP[value]
        else:
            try:
                value = int(value)
                if value >= 8:
                    raise ValueError()
            except ValueError as exc:
                raise ValueError(
                    'Colors should either a member of: {} or a positive '
                    'integer below 8'.format(', '.join(COLOR_NAMES))
                )
        return '{}{}'.format(self.PREFIX, value)
843296
public static String colorToHexString(int color) {
        return "#" + intToHex(Color.red(color), 2) + intToHex(Color.green(color), 2) + intToHex(Color.blue(color), 2);
    }
730424
@Pure
	public int getColor(int defaultColor) {
		final Integer c = getRawColor();
		if (c != null) {
			return c;
		}
		final BusContainer<?> container = getContainer();
		if (container != null) {
			return container.getColor();
		}
		return defaultColor;
	}
1237581
@Override
    public Color getColor( final String     key )
        throws
            UtilException
    {
        return formatColor( key, getRequiredPropValue( key ) );
    }
230521
public void setCornerColor(int index, Color color) {
        if (!isGradation()) {
            for (int i = 0; i < 4; i++) {
                cornerColor[i] = new RGBColor(0.0, 0.0, 0.0);
                cornerColor[i] = this.fillColor;
            }
            setGradation(true);
        }
        cornerColor[index] = color;
    }
815008
public Color getColorFor( double value ) {
        if (value <= min) {
            return colors[0];
        } else if (value >= max) {
            return colors[colors.length - 1];
        } else {
            for( int i = 1; i < colors.length; i++ ) {
                double v1 = values[i - 1];
                double v2 = values[i];
                if (value < v2) {

                    double v = (value - v1) / (v2 - v1);
                    Color interpolateColor = interpolateColor(colors[i - 1], colors[i], (float) v);
                    return interpolateColor;
                }
            }
            return colors[colors.length - 1];
        }
    }
73074
public static String toHex(Color color) {
		if(color != null) {
			return "#" + Integer.toHexString(color.getRed()) + Integer.toHexString(color.getGreen()) + Integer.toHexString(color.getBlue()); 
		}
		return null;
	}
29323
@SuppressWarnings({ "checkstyle:magicnumber", "static-method" })
	@Pure
	public Color rgb(int color) {
		final int red = (color & 0x00FF0000) >> 16;
		final int green = (color & 0x0000FF00) >> 8;
		final int blue = color & 0x000000FF;
		return Color.rgb(red, green, blue);
	}
523826
def get_color(self, color):
        '''
        
        '''
        if color is None:
            color = self.counter
        if isinstance(color, str):
            color = CNAMES[color]
        self.counter = color + 1
        color %= len(COLORS)
        return color
238237
public function getColorIndex($color)
    {
        $color = self::getColorAsFullHexCode($color);
        $index = array_search($color, $this->_colors);
        return $index !== false ? $index + 1 : false;
    }
1077282
def get_line_color(self, increment=1):
        

        i = self.line_colors_index

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

        return self.line_colors[i]
797352
public static MSColor valueOfIndexColor(final short index) {
        for(MSColor color : KNOWN_COLORS) {
            if(color.index == index){
                return color;
            }
            
        }
        
        return new MSColor(index);
    }
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);
  }