create_smooth_gradient: Create a gradient

Description Usage Arguments Examples

View source: R/Gradients.R

Description

This function creates an RGB gradient based on a series of functions

Usage

1
create_smooth_gradient(R, G, B, incr = 255)

Arguments

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.

Examples

 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)

muppetjones/remcolor documentation built on May 23, 2019, 8:22 a.m.