Updated on 2026-08-14

This commit is contained in:
Tangem 2021-04-02 12:42:36 +03:00
parent af1e74d115
commit a9d09cd5d5

View file

@ -3,9 +3,14 @@ package com.tangem.tap.common.extensions
import androidx.annotation.ColorInt
import androidx.core.graphics.toColorInt
import com.tangem.blockchain.common.Token
import com.tangem.wallet.R
@ColorInt
fun Token.getColor(): Int {
return ("#" + this.contractAddress.subSequence(2..7).toString())
.toColorInt()
return try {
("#" + this.contractAddress.subSequence(2..7).toString())
.toColorInt()
} catch (exception: Exception) {
R.color.lightGray4
}
}