Anyone using moko -resources for colors with compo...
# multiplatform
b
Anyone using moko -resources for colors with compose/swiftui? Their colour resource does not have resourceID, similarly to how we get strings - MR.strings.my_atring.resourceId
w
🤔 They should have
.color
and if I’m not mistake a
.color.uicolor
(for the Swift side)
b
yeah but on the android side that is of type moko.graphics, which doesn't really work. Anyways i found a way -
Copy code
color = Color(MR.colors.apple.color.rgba)
w
Okay, in Android should have the
Copy code
.colorInt()
Not sure with Compose.
It is an extension from MokoResources:
Copy code
@ColorInt
fun Color.colorInt(): Int {
    return argb.toInt()
}
304 Views