Convert or cast Material name to actual Material?

Don’t know if this is possible but I have a string value which is the name of the actual new material I need to change. In this case this is ‘newColor’.
Why doesn’t the following work?

 ReplaceMaterial((Material)newColor);
void ReplaceMaterial(Material mat)
    {
        MeshRenderer[] renderers = GetComponentsInChildren<MeshRenderer>();
        foreach (MeshRenderer r in renderers)
        {
            if (r.sharedMaterial == currentMaterial)
            {
                r.sharedMaterial = mat;
            }
            currentMaterial = mat;
        }
    }

You can’t simply convert a string to a material, because materials are their own data structure. You could load a material based on its name, using the Resources folder and Resources.Load. That said, if it’s not imperative that the material be chosen based on the name, it’d be more reliable to use a public Material reference that you’d drag into the inspector.

Thanks , yes thats what I’ve resorted to along with a dictionary