package com.ama.core.common.util

import android.content.Context
import android.content.res.Configuration
import android.util.TypedValue


fun Context.isDarkMode(): Boolean =
    resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES

fun Context.getDataFromThemeAttr(attr: Int) = TypedValue().apply {
    theme.resolveAttribute(attr, this, true)
}.data