When plotting using rgl plot3D I use something like this:
col = as.integer(as.factor(data[[input$colorBy]])))
plot3d(d[,1], d[,2], d[,3], type=type, col=col, add=TRUE)
However, this will repeat colors if there are more than 10 or so different factors. Is there any way to extend this so that there are never repeating colors, and (ideally) the colors span a large range of a colorspace?