In this paper, we investigate the resource sharing problem to optimize the system performance in device-to-device(D2D) communications underlaying full-duplex cellular networks. In the investigated scenario, D2D links, cellular uplinks and cellular downlinks are permitted to reuse the same spectrum resources under efficient interference control, leading to a more complicated interference relationship among the communications links when maximizing the network throughput via resource sharing. Therefore, we employ an interference graph to model the considered interference scenario, in which different communication links and the interference relationships among them are represented by the vertices and edges in the constructed interference graph, respectively. Then, we further propose a graph coloring based resource allocation scheme which can effectively allocate the spectrum resources to the communication links in order to maximize the network throughput with low computational complexity. Simulation results show that when allowing for the resource sharing among D2D links, cellular uplinks, and cellular downlinks, the network throughput can be effectively improved and our proposed scheme can solve this complicated resource sharing problem with low complexity and efficient resource allocation solutions.