package com.adealink.weparty.commonui.widget.util

import android.content.Context
import android.os.Build
import android.view.View
import androidx.annotation.ColorRes

fun Context.getColorX(@ColorRes id: Int): Int {
    return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        getColor(id)
    } else {
        resources.getColor(id)
    }
}

fun View.getColorX(@ColorRes id: Int): Int {
    return context.getColorX(id)
}