Learn R Programming

IDPmisc (version 0.3.1)

IDPcolorRamp: Color Ramp for Ordered Values

Description

Produces color ramps which change simultanously hues, saturation and values as defined in the hsv modus. This allows to produce especially smooth transitions from one color to the next. The default color ramp starts with light blue, continues with green, yellow, red and ends with dark violet.

Usage

IDPcolorRamp(n,
             colInt = data.frame(h = c(0.47, 0.28, 0.16, 0, 1, 0.8),
                                 s = c(0.31, 0.55, 0.7, 0.8, 0.8, 1),
                                 v = c(1, 1, 1, 1, 1, 0.4)),
             fr = c(0.27, 0.27, 0.27, 0))

Arguments

n
Total number of different colors in color ramp.
colInt
Data.frame or matrix with the columns h,s & v which defines the Intervals for individual color subramps, with nrow(colInt) = nsr+1 with nsr>1. See details
fr
Fraction of the colors in each of the first nsr-1 subramps.

Value

  • A vector of n colors.

Details

The function distributes the number of colors in the subramps, given the fractions fr, as smoothly as possible. There is at least one color in the first and the last subramp. Definition of hsv code: [object Object],[object Object],[object Object]

See Also

showColors, colorRamp, ColorBrewer

Examples

Run this code
IDPcolorRamp(10)

Run the code above in your browser using DataLab