Returns the red color component of a color from a vertex color set.

@param vertex the vertex index
@param colorset the color set
@return the red color component
178927
public float getColorR(int vertex, int colorset) {
        if (!hasColors(colorset)) {
            throw new IllegalStateException("mesh has no colorset " + colorset);
        }
        
        checkVertexIndexBounds(vertex);
        /* bound checks for colorset are done by java for us */
        
        return m_colorsets[colorset].getFloat(vertex * 4 * SIZEOF_FLOAT);
    }
701215
def get_vertex_surrounding_multicolor(graph, vertex):
    
    result = Multicolor()
    for edge in graph.get_edges_by_vertex(vertex):
        result += edge.multicolor
    return result
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);
        }
    }
1134792
public JFreeChartRender setGridPaint(Color color) {
        getPlot().setRangeGridlinePaint(color);
        getPlot().setDomainGridlinePaint(color);
        return this;
    }
535416
public void colorChannel(String channel, Color color){
    if(this.channelColors == null){
      this.channelColors = new HashMap<String,Color>();
    }
    this.channelColors.put(channel.toLowerCase(),color);
  }
80071
private static Collection<TileRef> getTiles(Map<ColorRgba, Collection<TileRef>> colors, ColorRgba color)
    {
        if (!colors.containsKey(color))
        {
            colors.put(color, new HashSet<TileRef>());
        }
        return colors.get(color);
    }
329125
@Override
    public int getIndexForColor(int rgb) {
        int red = (rgb >> 16) & 0xff;
        int green = (rgb >> 8) & 0xff;
        int blue = rgb & 0xff;

        OctTreeNode node = root;

        for (int level = 0; level <= MAX_LEVEL; level++) {
            OctTreeNode child;
            int bit = 0x80 >> level;

            int index = 0;
            if ((red & bit) != 0)
                index += 4;
            if ((green & bit) != 0)
                index += 2;
            if ((blue & bit) != 0)
                index += 1;

            child = node.leaf[index];

            if (child == null)
                return node.index;
            else if (child.isLeaf)
                return child.index;
            else
                node = child;
        }
        LOGGER.fine("getIndexForColor failed");
        return 0;
    }
1281033
public static int getColorAttr(Context ctx, @AttrRes int colorAttrId){
        int[] attrs = new int[] { colorAttrId /* index 0 */};
        TypedArray ta = ctx.obtainStyledAttributes(attrs);
        int colorFromTheme = ta.getColor(0, 0);
        ta.recycle();
        return colorFromTheme;
    }
1129746
@Override
    public Color getColor( final String     key,
                           final Color      defaultValue )
    {
        return formatColor( key, getFormattedPropValue( key ), defaultValue );
    }
1022312
public int getColor(float v) {
/*
		v *= 255;
		int n = (int)v;
		float f = v-n;
		if (n < 0)
			return map[0];
		else if (n >= 255)
			return map[255];
		return ImageMath.mixColors(f, map[n], map[n+1]);
*/
		int n = (int)(v*255);
		if (n < 0)
			n = 0;
		else if (n > 255)
			n = 255;
		return map[n];
	}
1289303
public void setColor(String red, String green, String blue, String alpha) {
		setColor(red, green, blue);
		setAlpha(alpha);
	}
868554
def setHotspotColor(self, color):
        
        color = QColor(color)
        if self._palette is None:
            self._palette = XNodePalette(self._scenePalette)
        
        self._palette.setColor(self._palette.NodeHotspot, color)
        self.setDirty()
608687
private static Color getColor(String colorString) {

		Color color = null;

		String[] colorParts = colorString.split(",");

		try {

			switch (colorParts.length) {

			case 1:
				Field field = Color.class.getField(colorString);
				color = (Color) field.get(null);
				break;

			case 3:
				color = new Color(Integer.parseInt(colorParts[0]),
						Integer.parseInt(colorParts[1]),
						Integer.parseInt(colorParts[2]));
				break;

			case 4:
				color = new Color(Integer.parseInt(colorParts[0]),
						Integer.parseInt(colorParts[1]),
						Integer.parseInt(colorParts[2]),
						Integer.parseInt(colorParts[3]));
				break;

			default:
				throw new GeoPackageException("Unexpected color arguments: "
						+ colorParts.length + ", color: " + colorString);
			}

		} catch (Exception e) {
			throw new GeoPackageException("Invalid color: " + colorString
					+ ", Allowable Formats: colorName | r,g,b | r,g,b,a", e);
		}

		return color;
	}
714588
public static String toColor(String red, String green, String blue) {
		return toColorWithAlpha(red, green, blue, null);
	}
270659
public static Integer parseWebColorAsAndroidColor(String input) {
		// Swap if input is #RRGGBBAA, but not if it is #RRGGBB
		Boolean swapAlpha = (input.length() == 9);
		try {
			Integer ret = Color.parseColor(input);
			if (swapAlpha) {
				ret = (ret >>> 8) | ((ret & 0x000000FF) << 24);
			}
			return ret;
		} catch (IllegalArgumentException e) {
			logException(e);
		}
		return null;
	}
32215
private void HSVtoRGB(float hue, float sat, float bri) {

        int i;
        float f;
        float p;
        float q;
        float t;
        if (sat == 0) {
            m_red = bri;
            m_green = bri;
            m_blue = bri;
            return;
        }
        hue /= 60;
        i = (int)Math.floor(hue);
        f = hue - i;
        p = bri * (1 - sat);
        q = bri * (1 - (sat * f));
        t = bri * (1 - (sat * (1 - f)));
        switch (i) {
            case 0:
                m_red = bri;
                m_green = t;
                m_blue = p;
                break;
            case 1:
                m_red = q;
                m_green = bri;
                m_blue = p;
                break;
            case 2:
                m_red = p;
                m_green = bri;
                m_blue = t;
                break;
            case 3:
                m_red = p;
                m_green = q;
                m_blue = bri;
                break;
            case 4:
                m_red = t;
                m_green = p;
                m_blue = bri;
                break;
            default: // case 5:
                m_red = bri;
                m_green = p;
                m_blue = q;
                break;
        }
    }
705340
public void setCornerColor(int index, Color color) {
        if (cornerColor == null) {
            for (int i = 0; i < cornerX.size(); i++) {
                cornerColor.add(new RGBColor(this.fillColor.getRed(), this.fillColor.getGreen(),
                    this.fillColor.getBlue(), this.fillColor.getAlpha()));
            }
            setGradation(true);
        }
        if (cornerColor.size() < cornerX.size()) {
            while (cornerColor.size() != cornerX.size()) {
                cornerColor.add(new RGBColor(this.fillColor.getRed(), this.fillColor.getGreen(),
                    this.fillColor.getBlue(), this.fillColor.getAlpha()));
            }
        }
        cornerColor.set(index, color);
    }