Updated on 2026-08-14
This commit is contained in:
parent
af1e74d115
commit
a9d09cd5d5
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue