On hit don't get destroyed but change color

Hi,
I want that an object don’t get destroyed but just change the color.
I have modified my previous script where it got destroyed.
But it is still getting destroyed.
What is wrong?

 private void OnCollisionEnter2D(Collision2D collision)
    {
        if (tag == "Breakable")
        {
            HandleHit();
        }
    }

    private void HandleHit()
    {
        timesHit++;
        int maxHits = hitSprites.Length + 1;
        if (timesHit >= maxHits)
        {
            HitBlock();           
            Debug.Log("Hit");
        }
        else
        {
            //ShowNextHitSprite();
        }
    }

private void HitBlock()
    {
        Debug.Log("HitBlock");
        PlayBlockDestroySFX();
        //Destroy(gameObject);
        GetComponent<SpriteRenderer>().color = hitColor;
        TriggerSparklesVFX();
    }

Do you maybe have a copy of the old script still on the object?

Does your console show any compile errors?

Thank you. No compile errors. In the previous script was just

Destroy(gameObject);

which I commented. I have added the line GetComponent<SpriteRenderer>().color = hitColor;
In the Inspector I can see that the color is changed.

This I have as component:

I have find out the BoxCollider2d ist still there but it is invisible.
I wonder why it invisible and does not apply the color as I can see it in the inspector.

I have found a solution. The block was still there but it was invisible. So I have added the alpha channel to the color:

GetComponent().color = new Color(1f, 1f, 1f, 1f);