https://kotlinlang.org logo
#korge
Title
# korge
k

kirillrakhman

06/05/2020, 1:20 PM
sorry, I'm a bit rusty on computer graphics. what's the easiest way to color a grayscale bitmap? I'm assuming using the
ColorFilter
but what to use as matrix?
This looks good:
Copy code
Matrix3D.fromColumns(
    color.rd, 0.0, 0.0, 0.0,
    0.0, <http://color.gd|color.gd>, 0.0, 0.0,
    0.0, 0.0, <http://color.bd|color.bd>, 0.0,
    0.0, 0.0, 0.0, 1.0
)
Copy code
ColorMatrixFilter(ColorMatrixFilter.GRAYSCALE_MATRIX)
5 Views