Description Usage Arguments Examples
This function creates an RGB gradient based on a series of functions
1 | create_smooth_gradient(R, G, B, incr = 255)
|
R |
A single parameter function for calculating the red value. |
G |
A single parameter function for calculating the green value. |
B |
A single parameter function for calculating the blue value. |
incr |
The number of steps to take in the gradient. Defaults to 255. |
1 2 3 4 5 6 7 8 9 10 | R <- function(x) {
0.237 - 2.13 * x + 26.92 * x^2 - 65.5*x^3 + 63.5*x^4 - 22.36*x^5
}
G <- function(x) {
((0.572 + 1.524 * x - 1.811 * x^2)/(1 - 0.291 * x + 0.1574 * x^2))^2
}
B <- function(x) {
1/(1.579 - 4.03*x + 12.92*x^2 - 31.4*x^3 + 48.6*x^4 - 23.36*x^5)
}
create_smooth_gradient(R, G, B)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.