<p>toRGB.</p>

@param color a {@link java.awt.Color} object.
@return a {@link java.lang.String} object.
978782
public static String toRGB(Color color)
    {
        String rgb = "#";
        rgb += formatAsHex( color.getRed() );
        rgb += formatAsHex( color.getGreen() );
        rgb += formatAsHex( color.getBlue() );
        return rgb;
    }
545370
public SimpleDialog messageTextColor(int color){
        if(mMessageTextColor != color){
            mMessageTextColor = color;
            if(mMessage != null)
                mMessage.setTextColor(color);
        }
        return this;
    }
1162505
public T setStrokeColor(final IColor color)
    {
        return setStrokeColor(null == color ? null : color.getColorString());
    }
732800
public void setColor(String color) {
		setRed(ColorUtils.getRed(color));
		setGreen(ColorUtils.getGreen(color));
		setBlue(ColorUtils.getBlue(color));
		String alpha = ColorUtils.getAlpha(color);
		if (alpha != null) {
			setAlpha(alpha);
		}
	}
966070
public static Color nameToColor(String strColor)
    {
        final Object[][] obj = {
            {"black", Color.black},
            {"blue", Color.blue},
            {"cyan", Color.cyan},
            {"darkGray", Color.darkGray},
            {"gray", Color.gray},
            {"green", Color.green},
            {"lightGray", Color.lightGray},
            {"magenta", Color.magenta},
            {"orange", Color.orange},
            {"pink", Color.pink},
            {"red", Color.red},
            {"white", Color.white},
            {"yellow", Color.yellow}
        };      // Not static, because this method is usually not called.
        for (int i = 0; i < obj.length; i++)
        {
            if (strColor.equalsIgnoreCase((String)obj[i][0]))
                return (Color)obj[i][1];
        }
        try {
            return Color.decode(strColor);
        } catch (NumberFormatException ex)  {
        }
        return null;
    }
1165567
public static Graphics2D createGraphics(BufferedImage image, Color color) {
		return GraphicsUtil.createGraphics(image, color);
	}
1209338
public static RgbaColor fromRgb(String rgb) {
        if (rgb.length() == 0) return getDefaultColor();

        String[] parts = getRgbParts(rgb).split(",");
        if (parts.length == 3) {
            return new RgbaColor(parseInt(parts[0]),
                                 parseInt(parts[1]),
                                 parseInt(parts[2]));
        }
        else {
            return getDefaultColor();
        }
    }
690761
public static String colorToHex(Color color) {
        return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue());
    }
903240
@CheckReturnValue
    public RoleAction setColor(Color color)
    {
        return this.setColor(color != null ? color.getRGB() : null);
    }
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;
	}
172525
public void setColor(final Color COLOR) {
        if (null == color) {
            _color = COLOR;
        } else {
            color.set(COLOR);
        }
    }
1373997
public final void setHelperTextColor(@ColorInt final int color) {
        this.helperTextColor = color;

        if (!(Boolean) leftMessage.getTag()) {
            leftMessage.setTextColor(color);
        }

        if (!(Boolean) rightMessage.getTag()) {
            rightMessage.setTextColor(color);
        }
    }
960785
function(name, value) {
                if (typeof value === "string") {
                    this.color[name] = new Color(value).toRGBA();
                } else {
                    this.color[name] = value.toRGBA();
                }
                return value;
            }
287400
public static Color toAWTColor(Vector4f c) {
        return new Color(c.getX(), c.getY(), c.getZ(), c.getW());
    }
1028792
public static String expandShorthandHexSingle(String color) {
		validateHexSingle(color);
		if (color.length() == 1) {
			color += color;
		}
		return color;
	}
901637
public static int getDeclinedColorFromColor(int color) {
        int bg = 0xffffffff;
        int a = DECLINED_EVENT_ALPHA;
        int r = (((color & 0x00ff0000) * a) + ((bg & 0x00ff0000) * (0xff - a))) & 0xff000000;
        int g = (((color & 0x0000ff00) * a) + ((bg & 0x0000ff00) * (0xff - a))) & 0x00ff0000;
        int b = (((color & 0x000000ff) * a) + ((bg & 0x000000ff) * (0xff - a))) & 0x0000ff00;
        return (0xff000000) | ((r | g | b) >> 8);
    }
500229
@SuppressWarnings({ "checkstyle:magicnumber", "static-method" })
	@Pure
	public Color rgba(int color) {
		final int alpha = (color & 0xFF000000) >> 24;
		final int red = (color & 0x00FF0000) >> 16;
		final int green = (color & 0x0000FF00) >> 8;
		final int blue = color & 0x000000FF;
		final double opacity;
		switch (alpha) {
		case 0:
			opacity = 0.;
			break;
		case 255:
			opacity = 1.;
			break;
		default:
			opacity = ((double) alpha) / 255;
		}
		return Color.rgb(red, green, blue, opacity);
	}