Fade an Image of Game Object

Hi

I am using the DOTween extension and have been trying to fade out a single Image component of a game object.
the game object is a child of a canvas.

This is my code

for(int i = 0; i < size; i++){
array*.getComponant().material.DOFade(0, 2);*
}
The issue is that when I do the above all the other children of the canvas gets faded out.
I am not sure how to use DOTween to just fade out a single image of a single Game Object
any help would be appreciated
Thx

If you want to fade just the Image, you need to fade its color component and not the material.

GetComponent<Image>().color;

Got it to work.

Imports were not set up properly

Thx