Accessing multiple materials on the same object

how would I access multiple materials on the same object? I have tried this:

Material[] materials;

void Start ()
{
    materials = GetComponents<Material>();
    print(materials[0].color);
    print(materials[1].color);
}

but its triggering an error saying getcomponents requires that the Material component is derived from a monobehavior, im just using the standard shader for both materials.

Materials are assigned to the Renderer component, so GetComponent that instead.

 Material[] materials;
 void Start ()
 {
     materials = GetComponent<Renderer>().materials;
     print(materials[0].color);
     print(materials[1].color);
 }