The Resources.getColor(int id) method has been deprecated.
Resources.getColor(int id)
@ColorInt @Deprecated public int getColor(@ColorRes int id) throws NotFoundException
In Kotlin, you can do:
ContextCompat.getColor(requireContext(), R.color.stage_hls_fallback_snackbar)
if requireContext() is accessible from where you are calling the function. I was getting an error when trying
ContextCompat.getColor(context, R.color.stage_hls_fallback_snackbar)