Change the Text Color in InputField on the fly

Using this code as part of a validation to make sure the username they selected is available. I need to be able to change the text to Green if Success and Red if not. Im getting no Errors but Inputted text is still black

if (j ["data"] ["status"].str == "success") {
			_isValid = true; 
			ColorBlock cb = UsernameField.colors;
			cb.normalColor = Color.green;
			UsernameField.colors = cb;
		} else {
			_isValid = false;
			ColorBlock cb = UsernameField.colors;
			cb.normalColor = Color.red;
			UsernameField.colors = cb;
		}

The input text color is not part of the InputField’s ColorBlock. In the hierarchy, you’ll find that InputField has a child GameObject named Text. It’s this child Text component that you want to change.

Text text = UsernameField.transform.FindChild("Text").GetComponent<Text>();
text.color = Color.green;