'Sprite won't render by setting .GetComponent<SpriteRenderer>().color property

I am making a tower defense game, but my sprite doesn't render when I run the code shown below.

I first made two public colors and named them startColor and endColor

public Color startColor;
public Color endColor;

Then at the end of the code I made the startTile and the endTile(startTile and endTile are just variables for my sprites that start the path and end the path). I then tell my code to get the renderer and .color to change the color to startcolor and endcolor but it just the changed colors and doesn't actually render

startTile.GetComponent<SpriteRenderer>().color = startColor;
endTile.GetComponent<SpriteRenderer>().color = endColor;

no error messages if u need more context my yt is RFG game dev and just join my discord pls help



Solution 1:[1]

Make sure the alpha channel is not at 0.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KYL3R