private Bitmap createBase(int color){
  Bitmap finalImg=Bitmap.createBitmap(mSize,mSize,Bitmap.Config.ARGB_8888);
  mCanvas.setBitmap(finalImg);
  mCanvas.save();
  float[] hsv=new float[3];
  Color.colorToHSV(color,hsv);
  if (hsv[1] == 0) {
    hsv[2]=Math.min(hsv[2],MAX_WHITE_BRIGHTNESS);
  }
 else {
    hsv[2]=Math.min(hsv[2],MAX_COLOR_BRIGHTNESS);
    hsv[1]=Math.max(MIN_COLOR_SATURATION,hsv[1]);
  }
  int colorMid=Color.HSVToColor(hsv);
  hsv[2]+=0.1f;
  int colorTop=Color.HSVToColor(hsv);
  hsv[2]-=0.2f;
  int colorBot=Color.HSVToColor(hsv);
  float edge=mSize * 0.01f;
  mCanvas.translate(-edge,-edge);
  mPaint.setColor(colorTop);
  mCanvas.drawPath(mRoundRect,mPaint);
  mPaint.setColor(colorBot);
  mPaint.setXfermode(new PorterDuffXfermode(Mode.XOR));
  mCanvas.translate(edge,edge);
  mCanvas.drawPath(mRoundRect,mPaint);
  mPaint.setColor(colorMid);
  mPaint.setXfermode(new PorterDuffXfermode(Mode.DST_OVER));
  mCanvas.drawPath(mRoundRect,mPaint);
  mCanvas.restore();
  mCanvas.setBitmap(null);
  mPaint.setXfermode(null);
  return finalImg;
}

private Bitmap createBase ( int color ) { Bitmap finalImg = Bitmap . createBitmap ( mSize , mSize , Bitmap . Config . ARGB_8888 ) ; mCanvas . setBitmap ( finalImg ) ; mCanvas . save ( ) ; float [ ] hsv = new float [ 3 ] ; Color . colorToHSV ( color , hsv ) ; if ( hsv [ 1 ] == 0 ) { hsv [ 2 ] = Math . min ( hsv [ 2 ] , MAX_WHITE_BRIGHTNESS ) ; } else { hsv [ 2 ] = Math . min ( hsv [ 2 ] , MAX_COLOR_BRIGHTNESS ) ; hsv [ 1 ] = Math . max ( MIN_COLOR_SATURATION , hsv [ 1 ] ) ; } int colorMid = Color . HSVToColor ( hsv ) ; hsv [ 2 ] += 0.1f ; int colorTop = Color . HSVToColor ( hsv ) ; hsv [ 2 ] -= 0.2f ; int colorBot = Color . HSVToColor ( hsv ) ; float edge = mSize * 0.01f ; mCanvas . translate ( - edge , - edge ) ; mPaint . setColor ( colorTop ) ; mCanvas . drawPath ( mRoundRect , mPaint ) ; mPaint . setColor ( colorBot ) ; mPaint . setXfermode ( new PorterDuffXfermode ( Mode . XOR ) ) ; mCanvas . translate ( edge , edge ) ; mCanvas . drawPath ( mRoundRect , mPaint ) ; mPaint . setColor ( colorMid ) ; mPaint . setXfermode ( new PorterDuffXfermode ( Mode . DST_OVER ) ) ; mCanvas . drawPath ( mRoundRect , mPaint ) ; mCanvas . restore ( ) ; mCanvas . setBitmap ( null ) ; mPaint . setXfermode ( null ) ; return finalImg ; }
creates a rounded rect with the given color .
