Chancing color through its variable doesn't work?

Hi. So I have this parent class MapTileClass, and each tile in my game has its own script which inherits from this class.
On awake i’m trying to change all tiles color to black.

Why does this works:

  GetComponent<SpriteRenderer>().color = new Color(0f, 0f, 0f);

While this doesn’t:

    public Color tileColor;

    void Awake()
    {
        tileColor = GetComponent<SpriteRenderer>().color;
        tileColor = Color.black;
    }

I’m calling the change in the parent class, which is not attached to any gameobject.

@devcor, hi.

You need to use Color32.

try use this:

#pragma warning disable 649
        [SerializeField]
        private SpriteRenderer ChickenSpriteRenderer;
        [SerializeField]
        private Color32 ChickenSpriteRendererColor32;
#pragma warning restore 649
        // Use this for initialization

        private void Start()
        {
            ChickenSpriteRenderer.color = ChickenSpriteRendererColor32;
        }

89906-blankpanel-1.png