rive-app / rive-ios

iOS runtime for Rive
MIT License
484 stars 55 forks source link

Set color of icon #191

Closed derech1e closed 2 years ago

derech1e commented 2 years ago

Hey, is there currently a way to set the color of an icon in SwiftUI programmatically?

The idea is that the icon automatically obtains the color from the background color like seen below.

Bildschirmfoto 2022-05-29 um 20 43 59

So in the previous Image I solved this by using the blend mode in SwiftUI .blendMode(selectedTab == tab.selection ? .overlay : .normal)

But this don't quite work as you can see below. Bildschirmfoto 2022-05-29 um 20 46 11

Is there any solution or already plans/thoughts to implement this?

Thank you for your great Software!

zplata commented 2 years ago

@derech1e - There isn't a great way to get into that granular level of dynamically changing fills on particular nodes yet - however, you might try creating different states for the icon in a state machine that has fills for the different cases in your project.