Useful for showing continuous palettes

ramp(
  colors,
  n = 512,
  height = 40,
  margin = 0,
  background = NULL,
  elementId = NULL
)

Arguments

colors

character vector of CSS colors. Can be hex codes, etc.

n

numeric number of colors to interpolate into the ramp. Uses d3.interpolateRgbBasis() to interpolate.

height

numeric height of widget (pixels).

margin

numeric margin around the canvas (pixels).

background

character CSS color for the canvas background.

elementId

character ID for the enclosing element.

Value

htmlwidget

Examples

ramp(terrain.colors(100))