I did it in another way, which may be partially okay. For example, I know I have 47 clusters, I choose to specify the color of the clusters rather than using the default color like this:
install.packages("plyr")
library(plyr)
new_colors <- revalue(as.character(clusters_name), c("1"="yellow4", "2"="aliceblue","3"="antiquewhite","4"="white", "5"="azure", "6"="beige", "7"="bisque","8"="black","9"="blue", "10"="blueviolet", "11"="brown", "12"="burlywood","13"="cadetblue","14"="chartreuse", "15"="chocolate", "16"="coral", "17"="cornflowerblue","18"="cornsilk","19"="cyan", "20"="darkblue", "21"="darkgray", "22"="darkgreen","23"="darkmagenta","24"="darkorange", "25"="darkred", "26"="darkviolet", "27"="gold","28"="gray","29"="green", "30"="greenyellow", "31"="honeydew", "32"="hotpink","33"="ivory","34"="khaki", "35"="lavender", "36"="lawngreen", "37"="lightblue","38"="lightcoral","39"="lightgreen", "40"="lightseagreen", "41"="magenta", "42"="maroon","43"="mediumaquamarine","44"="mediumorchid", "45"="navy", "46"="olivedrab", "47"="orange"))
heatmap.2((alpha6), Rowv=as.dendrogram(hc), RowSideColors=new_colors, trace="none", scale="row", density.info="none", col=redblue(2766))
This tells me cluster 1 has 'yellow4' color and so in. Using the color code, I can manually update the cluster no. in the dendrogram. If my technique is useful somebody may use it.