Updated on 2026-08-14

This commit is contained in:
Tangem 2022-04-09 14:25:04 +03:00
parent e90cd6d727
commit cf2b5f7913
2 changed files with 7 additions and 3 deletions

View file

@ -10,7 +10,11 @@ import androidx.core.graphics.red
/**
[REDACTED_AUTHOR]
*/
fun Color.argb(): Int {
fun Color.toAndroidGraphicsColor(): Int {
val argb = this.toArgb()
return android.graphics.Color.argb(argb.alpha, argb.red, argb.green, argb.blue)
}
fun Color.parse(hexColor: String): Color {
return Color(hexColor.removePrefix("#").toInt(16))
}

View file

@ -24,7 +24,7 @@ import androidx.compose.ui.viewinterop.AndroidView
import com.tangem.tangem_sdk_new.extensions.dpToPx
import com.tangem.tap.common.compose.SpacerS16
import com.tangem.tap.common.compose.SpacerS24
import com.tangem.tap.common.extensions.compose.argb
import com.tangem.tap.common.extensions.compose.toAndroidGraphicsColor
import com.tangem.wallet.R
@Composable
@ -95,7 +95,7 @@ fun SubtitleText(subtitleText: String, subtitleTextId: Int?) {
textAlignment = View.TEXT_ALIGNMENT_CENTER
typeface = Typeface.DEFAULT
setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f)
setTextColor(color.argb())
setTextColor(color.toAndroidGraphicsColor())
}
}
}