How can I compare two tilemaps by color?

I have two grids that contains different tilemap
and I want to compare those two tilemaps by color
is it possible?
Can I know if two grids’ tilemap’s color are same?

Try this:

public bool IsSameColor(Color c1, Color c2){
    return c1.r == c2.r && c1.g == c2.g && c1.b == c2.b && c1.a == c2.a

Calling the function:

IsSameColor(tile1.GetComponent<Material>().color, tile2.GetComponent<Material>().color);
  • make sure that the tiles have a material