public static Bitmap tint ( @ NonNull final Bitmap bitmap , @ ColorInt final int color ) { Condition . INSTANCE . ensureNotNull ( bitmap , "The bitmap may not be null" ) ; Canvas canvas = new Canvas ( bitmap ) ; Paint paint = new Paint ( ) ; paint . setColor ( color ) ; canvas . drawRect ( new Rect ( 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) ) , paint ) ; return bitmap ; }
Creates and returns a bitmap by overlaying it with a specific color .