@Nullable
    public static ColorStateList getColorStateList(@NonNull Context context,
                                                   @ColorRes int id) {
        if (Build.VERSION.SDK_INT >= 23) {
            return context.getColorStateList(id);
        } else {
            return context.getResources().getColorStateList(id);
        }
    }
Returns a color state list associated with a particular resource ID.
<p>
Starting in {@link Build.VERSION_CODES#M}, the returned
color state list will be styled for the specified Context's theme.

@param id The desired resource identifier, as generated by the aapt
          tool. This integer encodes the package, type, and resource
          entry. The value 0 is an invalid identifier.
@return A color state list, or {@code null} if the resource could not be
resolved.
@throws android.content.res.Resources.NotFoundException if the given ID
                                                        does not exist.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/ContextCompat.java