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

nuhkoca

12/24/2022, 1:20 AM
Hello, I have a question about constraint Compose components to use certain colors from the theme. Let’s say I have a disclaimer component that can only use red or green and nothing else. How can I conform this by having a color parameter?
d

dorche

12/24/2022, 1:40 AM
You don't, just pass an enum or boolean or something that lets you infer which color to use in the component
n

nuhkoca

12/24/2022, 3:57 PM
I see. Thank you!
4 Views