How can I pass a gradient using brush api to a composable who has a color parameter exposed as Color type ?
a
André Kindwall
04/22/2021, 10:57 AM
What composable is it?
z
Zach Klippenstein (he/him) [MOD]
04/22/2021, 2:24 PM
The short answer is you can’t - Brush is effectively a supertype of Color (not actually in the type system, but in terms of features), not the other way around. But most Material components expose overloads for both.
s
Shivam Sethi
04/22/2021, 7:10 PM
It is for Indicator composable that comes with TabRow, but it’s implementation was simple so I ended up creating another composable that does the same thing except uses brush or color for background.
z
Zach Klippenstein (he/him) [MOD]
04/22/2021, 7:10 PM
Might wanna file an issue, seems like something that should be built in