material color?

Hello, I am having an issue with a sprite renderers color. I currently am clicking an object and its color is changed via the sprite renderer

                SpriteRenderer spriteRenderer = hit.collider.gameObject.GetComponent<SpriteRenderer>();
                spriteRenderer.material.color = selectColorScript.getCurrentColour();

However I am wanting to use the spriteRenderers material color in another script. So I am just using

  private void Start()
    {
        spriteRenderer = GetComponent<SpriteRenderer>();
    }

    void Update()
    {
        currentColour = spriteRenderer.color;
    }

But when I run this code, the color is always set to white. but there seems to be a change in the sprite- Default material. Is this material different from the material used to get the color (spriteRenderer.material.color) The image below shows where the color change shows in the inspector 8643786--1162695--upload_2022-12-8_1-6-5.png

Calling .material on any renderer will make a instance/clone of that renderer’s shared material, as explained in the manual:
https://docs.unity3d.com/ScriptReference/Renderer-material.html

That’s why your sprite’s material name has (Instance) at the end.

on other hand, sprite.color and sprite.material.color are not the same thing. sprite.color is the color of the sprite mesh, which gets later tinted by the color of the material.

Either set and get the color of the material, or set and get the color of the sprite mesh. Right now you’re copying the material, assigning a color to that material, then getting the color of the sprite (which is still white because you haven’t changed it anywhere)