#==========================================================================================#
#==========================================================================================#
# Function that creates a nice greyscale colour scheme (dark to bright). #
#------------------------------------------------------------------------------------------#
greys.brighten <<- function(n){
rrr = c( 10, 245)
ggg = c( 10, 245)
bbb = c( 10, 245)
pivot = round(seq(from=1,to=n,by=(n-1)/(length(rrr)-1)),digits=0)
red = pmin(255,pmax(0,as.integer(spline(x=pivot,y=rrr,n=n)$y)))
green = pmin(255,pmax(0,as.integer(spline(x=pivot,y=ggg,n=n)$y)))
blue = pmin(255,pmax(0,as.integer(spline(x=pivot,y=bbb,n=n)$y)))
mycolsch = rgb(r=red,g=green,b=blue,maxColorValue=255)
return(mycolsch)
}#end function greys.brighten
#==========================================================================================#
#==========================================================================================#
#==========================================================================================#
#==========================================================================================#
# Function that creates a nice greyscale colour scheme. #
#------------------------------------------------------------------------------------------#
greys.darken <<- function(n){
mycolsch = rev(greys.brighten(n))
return(mycolsch)
}#end function greys.darken
#==========================================================================================#
#==========================================================================================#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.