On 10/10/2009 06:41 PM, Jim Lemon wrote:
Oops, should be:
gimmeDiffCol<-function(oldcol) { rgbcomp<-col2rgb(oldcol) if(rgbcomp[1,1]<127) newred<-sample(rgbcomp[1,1]:255,1)/255 else newred<-sample(0:rgbcomp[1,1],1)/255 if(rgbcomp[2,1]<127) newgreen<-sample(rgbcomp[2,1]:255,1)/255 else newgreen<-sample(0:rgbcomp[2,1],1)/255 if(rgbcomp[3,1]<127) newblue<-sample(rgbcomp[3,1]:255,1)/255 else newblue<-sample(0:rgbcomp[3,1],1)/255 return(rgb(newred,newgreen,newblue)) }
Jim ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.