UI text color not assigning correctly

Okay, so after looking at a few things, I thought I’d start scripting some text fading for an intro.

I assign objColour the UI text’s colour (using gameObject.GetComponent), and then in the Fade routine, I immediately set it to red (it starts white, the red is for testing purposes).
However, the text will not change colour unless the color is directly set from GetComponent.

See this .cs file - the current state of it will not change the text, but if the commented-out line is uncommented, it will change the text.
Screenshot

Reason I want to use objColour is because writing gameObject.GetComponent().color = Color(…); every time I wish to set it makes things far less readable.

Unity version is 5.2

This happens because when you do objColour = GetC().color, you get the color of the text, not the field reference to it. Right now you get a reference to Color object, later you simply change that object to another one, but the text color is still referencing the original color.

To do what you want you should do obj = GetComponent()-text- and then in Fade obj.color = …

void Start(){
	obj = GetComponent<Text>();
	...coroutine...
}
IEnumrator Fade(...){
	obj.color = Color.red;
}

Something like that

Color is a struct and in C# structs are passed by value. It means when you get the color of the Text component a copy of the Color struct with the same values of Text.color will be created for you. Then when you change that color, your color will be modified which is a copy and the original Text.color will not be modified. If it was a class (classes are pass by reference) a reference of the Text.color would be provided to you and your modifications would be reflected on Text.color, in order to change the color of the Text you need to store the Text component in a variable and modify its color.
var text = gameObject.GetComponent();
text.color=yourDesiredColor;

To make the fade beautiful , other than using Color.Lerp you can use an AnimationCurve and use its Evaluate method to get a value between 0 and 1 for the Lerp based on its curve. then you can play with the curve’s shape in editor if
AnimationCurve is a public field and visible in inspector. Otherwise you have to change the weight of the Lerp using a formula in code, linear or square or …