####################################################################################################################################
################################## Function_title_TOP ##############################################################################
# >>
darken <- function( color, factor = 1.5 ){
col <- col2rgb(color)
col <- col/factor
col <- rgb(t(col), maxColorValue=255)
col
}
# <<
################################## Function_title_BOTTOM ###########################################################################
####################################################################################################################################
####################################################################################################################################
################################## Function_title_TOP ##############################################################################
# >>
lighten <- function( color, factor = 0.3) {
if ((factor > 1) | (factor < 0)) stop("factor needs to be within [0,1]")
col <- col2rgb(color)
col <- col + (255 - col)*factor
col <- rgb(t(col), maxColorValue=255)
col
}
# <<
################################## Function_title_BOTTOM ###########################################################################
####################################################################################################################################
####################################################################################################################################
################################## Help Code #######################################################################################
# >>
# out = Function_name(arg)
# out = lighten(arg)
# <<
################################## Help Code #######################################################################################
####################################################################################################################################
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.