Code example for TextPaint

Methods: setARGB

0
		TextPaint tp;
		@Override 
		Drawable getTile(int x, int y) {	
			Bitmap bmp = Bitmap.createBitmap(getTileSize(), getTileSize(), Bitmap.Config.ARGB_8888);
			if (tp == null) {
				tp = new TextPaint();
				tp.setARGB(255, 255, 255, 255);
			} 
			Canvas c = new Canvas(bmp);
			c.drawRGB(r.nextInt(256), r.nextInt(256), r.nextInt(256));
			c.drawText(String.format("%1$d,%2$d", x, y), 0, getTileSize(), tp);
			return new BitmapDrawable(bmp);
		} 
    } 
}