How to send Color.black as a string but it will act like code. See description for more.

I want to send String as a Parameter.
String will contain the code.
when it will pass and when it comes to execution it will be converted into code.

like

void Start()
{
     COLORMATC("Color.black");
}
void COLORMATC(Color c)
{
        Debug.Log(c)
}

Something like that. Is it possible?

The best you can AFAIK is to give “black” as parameter and use reflection:

     // Put this at the top of your script
     using System.Reflection;

    public void ColorMatC( string c )
    {
        Type type = typeof(Color);
        var property = type.GetProperty(c, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
        if( property == null )
            throw new System.ArgumentException("No property named " + c + " exist in the Color type");
        Color color = (Color) property.GetValue(null);
        Debug.Log( color ) ;
    }