Learn R Programming

DeducerText (version 0.1-2)

make.color.scale: Make Color Scale

Description

Construct 2 color gradient for the function 'wordcloud'.

Usage

make.color.scale(aColor, bColor, steps, gradientExp=.5)

Arguments

aColor
The starting color of the gradient
bColor
The ending color of the gradient
steps
The number of elements in the outpus gradient vector
gradientExp
A parameter for controlling the interpolation between the 2 colors. a value of 1 will yield straight linear interpolation between the colors. A value lessthan 0 will cause the gradient to rapidly transition and plateau into the the second color,

Value

A vector of colors (represented by character strings) giving a smooth transition between the 2 input colors.

Examples

Run this code
# Make a cyan to red gradient with 10 steps.
make.color.scale(c(0,1,1), c(1,0,0),10,1)

Run the code above in your browser using DataLab