androidMain.tech.skot.view.extensions.ContextExtensions.kt Maven / Gradle / Ivy
package tech.skot.view.extensions
import android.content.Context
import android.util.TypedValue
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt
@ColorInt
fun Context.getColorFromAttr(@AttrRes attr:Int):Int {
val typedValue = TypedValue()
theme.resolveAttribute(attr, typedValue, true)
return typedValue.data
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy