https://kotlinlang.org logo
#compose
Title
# compose
z

Zsolt

03/19/2020, 11:20 PM
(Draw)Image used to have
tint
parameter, which is gone now. I see
colorFilter
which needs a
BlendMode
beyond just passing the color. Looking at the possible values,
hue
is the one I guess I should use (commented "The effect is to tint the destination image with the source image."). To my disappointment this is how it looks:
Copy code
hue(null), // Not Supported
Is there any other suitable replacement to achieve tinting the image?
l

Leland Richardson [G]

03/19/2020, 11:47 PM
From a colleague:
ColorFilter.tint
We needed to make this API a bit more generic to consume a wider range of values for applying ColorFilter parameters so what was previously
Copy code
Image(image, tint = Color.Red)
is now
Copy code
Image(image, colorFilter = ColorFilter.tint(Color.Red))
z

Zsolt

03/20/2020, 2:06 AM
Thanks! I can't seem to find ColorFilter.tint, was it released with dev07?
l

Leland Richardson [G]

03/20/2020, 2:53 AM
looks like it just missed the cut. It is just shorthand for
ColorFilter(color, BlendMode.srcIn)
though
6 Views