Private method.

Returns a {@link GradientDrawable} with
slightly rounded corners.

@param color The desired color of the GradientDrawable
@return A {@link GradientDrawable}
169766
private static GradientDrawable getStandardBackground(int color) {
        final GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setCornerRadius(BackgroundUtils.convertToDIP(4));
        gradientDrawable.setColor(color);
        return gradientDrawable;
    }
422319
@CheckReturnValue
    public RoleManager setColor(Color color)
    {
        this.color = color == null ? Role.DEFAULT_COLOR_RAW : color.getRGB();
        set |= COLOR;
        return this;
    }
1091523
public static void fillCircle(Graphics g, Point center, int diameter, Color color){
		fillCircle(g, (int) center.x, (int) center.y, diameter, color);
	}
407100
public static Drawable getDrawable(Resources.Theme theme, TypedArray a, TypedValue[] values, int index) {

        if (values != null && theme != null) {
            TypedValue v = values[index];

            if (v.type == TypedValue.TYPE_ATTRIBUTE) {
                TEMP_ARRAY[0] = v.data;
                TypedArray tmp = theme.obtainStyledAttributes(null, TEMP_ARRAY, 0, 0);
                try {
                    return tmp.getDrawable(0);
                } finally {
                    tmp.recycle();
                }
            }
        }

        if (a != null) {
            return LollipopDrawablesCompat.getDrawable(a, index, theme);
        }

        return null;
    }
679272
public void setArrowColor(@ColorInt int color) {
    arrowColor = color;
    arrowColorDisabled = Utils.lighter(arrowColor, 0.8f);
    if (arrowDrawable != null) {
      arrowDrawable.setColorFilter(arrowColor, PorterDuff.Mode.SRC_IN);
    }
  }
495254
@NonNull
    public IconicsDrawable backgroundContourColor(@NonNull ColorStateList colors) {
        if (colors != null) {
            mBackgroundContourBrush.setColors(colors);
            if (mBackgroundContourBrush.applyState(getState())) {
                invalidateSelf();
            }
        }
        return this;
    }
153998
public Paint getTopShadowGradient(Shape s) {
        Rectangle2D bounds = s.getBounds2D();
        float       minY   = (float) bounds.getMinY();
        float       maxY   = (float) bounds.getMaxY();
        float       midX   = (float) bounds.getCenterX();

        return new LinearGradientPaint(midX, minY, midX, maxY, (new float[] { 0f, 1f }), new Color[] { innerShadow.top, transparentColor });
    }
312081
public static Geometry createShape(String name, Mesh shape, ColorRGBA color) {
        checkInit();
        
        Geometry g = new Geometry(name, shape);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.getAdditionalRenderState().setWireframe(true);
        mat.setColor("Color", color);
        g.setMaterial(mat);
        return g;
    }
287400
public static Color toAWTColor(Vector4f c) {
        return new Color(c.getX(), c.getY(), c.getZ(), c.getW());
    }
545060
public static StateListDrawable getDrawerItemBackground(int selected_color) {
        ColorDrawable clrActive = new ColorDrawable(selected_color);
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[]{android.R.attr.state_selected}, clrActive);
        return states;
    }
127126
private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
        Rectangle r      = s.getBounds();
        int       width  = r.width;
        int       height = r.height;

        return createGradient(r.x + width / 2, r.y, r.x + width / 2, r.y + height - 1, new float[] { 0f, 1f }, new Color[] { top, bottom });
    }
16569
function getColourAt(gradient, p) {
  p = clamp(p, 0, 0.9999);  // FIXME
  let r = Math.floor(p * (gradient.length - 1));
  let q = p * (gradient.length - 1) - r;
  return Colour.mix(gradient[r + 1], gradient[r], q);
}
123706
public static RoundedBitmapDrawable fromBitmapDrawable(
      Resources res,
      BitmapDrawable bitmapDrawable) {
    return new RoundedBitmapDrawable(res, bitmapDrawable.getBitmap(), bitmapDrawable.getPaint());
  }
539015
private Paint createGraphicInnerShadowGradient(Shape s) {
        Rectangle2D b    = s.getBounds2D();
        float       midX = (float) b.getCenterX();
        float       y1   = (float) b.getMinY();
        float       y2   = (float) b.getMaxY();

        return createGradient(midX, y1, midX, y2, new float[] { 0f, 0.43f, 0.57f, 1f },
                              new Color[] { graphicInnerShadow1, graphicInnerShadow2, graphicInnerShadow3, graphicInnerShadow4 });
    }
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);
	}
858448
public static Drawable getCompatDrawable(Context c, int drawableRes) {
        Drawable d = null;
        try {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                d = c.getResources().getDrawable(drawableRes);
            } else {
                d = c.getResources().getDrawable(drawableRes, c.getTheme());
            }
        } catch (Exception ex) {
        }
        return d;
    }
1125993
public final void setDialogBackgroundColor(@ColorInt final int color) {
        this.dialogBackground = new ColorDrawable(color);
        this.dialogBackgroundBitmap = null;
        this.dialogBackgroundId = -1;
        this.dialogBackgroundColor = color;
    }