Learn R Programming

toaster (version 0.5.5)

getGradientPaletteFactory: Generate gradient palette maker

Description

inspired by http://stackoverflow.com/questions/13353213/gradient-of-n-colors-ranging-from-color-1-and-color-2

Usage

getGradientPaletteFactory(colors = c("black", "white"))

Arguments

colors
pair of colors for gradient range (min, max): default is c('black','white')

Value

function (factory) that creates linear gradient palette for given number of colors

See Also

getDiscretePaletteFactory, colorRampPalette

Examples

Run this code
paletteMaker = getGradientPaletteFactory(c("yellow","red"))
myPalette = paletteMaker(10)

Run the code above in your browser using DataLab