I have an ordinary EditText field that I would like to programmatically change the underline color for.
@degs's answer is correct. But just add one little note: the AppCompatEditText#setSupportBackgroundTintList is now annotated with @RestrictTo(LIBRARY_GROUP) which means:
Restrict usage to code within the same group of libraries
Instead use ViewCompat#setBackgroundTintList. So in your example, it should look like this:
ColorStateList colorStateList = ColorStateList.valueOf(color);
ViewCompat.setBackgroundTintList(editText, colorStateList);