With pheatmap, not really. What you can do is add an annotation color bar:
annotation_df <- data.frame(ann = c(rep("Aa",5), rep("Bb",5)),
row.names = rownames(li.A))
pheatmap(li.A, annotation_row = annotation_df)
With heatmap.2, a quick look at the man page suggests colRow and colCol might do it, I've never tried.
Else, I can imagine complexHeatmap will let you do that.