This is probably not the most efficient solution and it would be quite cumbersome to write.
Consider a graph where each node is a tree that has the given root. There is a side from one node A to another B if B consists of A with one extra edge. We could traverse this hyper graph with a BFS and stop when we find a spanning tree. In fact, we could also work out the case when there is not such a tree.
Say that you are given a graph by (id, vertex, vertex, color) defined by (1, e1, e2, b),(2, e1, e3, r),(3, e1, e4, b) and the root node is e4.
First element of the iteration would be (-1, e4, nil) (-1 is id of edge to arrive to the node, nil represents the color with which you arrive from root)
Next iteration we have [(-1, e4, nil), (3, e1, b)].
In the third, iteration, as we are arriving to e1 with blue, we can only add [(-1, e4, nil), (3, e1, b), (2, e3, r)]
In this example, there was only one possible edge addition. In general, we would need to keep track of all possible trees at a given point.
Note that the hypergraph of trees is a DAG (every side adds an edge, after n steps you arrive to a tree that has more edges that the one you started with).