Skip to content

Instantly share code, notes, and snippets.

@lidemin
Created July 9, 2016 16:00
Show Gist options
  • Save lidemin/7dc80a5ed49e7925a88c3c9253514ae5 to your computer and use it in GitHub Desktop.
Save lidemin/7dc80a5ed49e7925a88c3c9253514ae5 to your computer and use it in GitHub Desktop.
Just for testing.
@Override
public synchronized Bitmap getMosaicTile(String hexColor, int tileWidth, int tileHeight) throws Exception {
Bitmap newBmp = Bitmap.createBitmap(tileWidth, tileHeight, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newBmp);
RectF rectF = new RectF(padding, padding, tileWidth - padding, tileHeight - padding);
paint.setColor(Color.parseColor("#" + hexColor));
canvas.drawRoundRect(rectF, radius, radius, paint);
return newBmp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment