NB will return labels in dendrogram order, not in the order of the original labels retained in object$labels ususally corresponding to the row or column names of the dist object provided to hclust.
The distinctive feature of this function is to colour both the terminal leaves of a cluster and the edges leading to those leaves. The edgePar attribute of nodes will be augmented by a new list item col. The groups will be defined by a call to slice using the k or h parameters.
slice
(Package: dendroextras) :
Cut a tree-like object into groups numbered in tree order
In comparison with cutree, the groups are numbered from left to right as per the tree when plotted in its standard horizontal form. Note also that the return value will have the leaves sorted in dendrogram order.