bill
05/04/2023, 10:04 AMexpect class Color
// androidMain
actual typealias Color = androidx.compose.ui.graphics.Color
// iosMain
actual typealias Color = platform.UIKit.UIColor
but it fail because UIColor and compose Color has different constructor. Can we have a workaround in this case?Oktay Duman
05/04/2023, 10:40 AMfun Int.toUIColor(): UIColor {
return asd(
red = (this shr 16) and 0xFF,
green = (this shr 8) and 0xFF,
blue = this and 0xFF,
a = (this shr 24) and 0xFF
)
}
const val wrongAnswerColor: Int = 0x61B60202
val wrongAnswerColor = ColorObject.wrongAnswerColor.toUIColor()
after this I can use it in Xcode
//swift
textBackColor: IosColorObject.shared.wrongAnswerColor