swatch: Create swatch widget

Description Usage Arguments Value Examples

View source: R/swatch.R

Description

Useful for showing discrete palettes

Usage

1
2
3
4
5
6
7
8
swatch(
  colors,
  height = 40,
  dx = 10,
  margin = 0,
  background = NULL,
  elementId = NULL
)

Arguments

colors

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

height

numeric height of widget (pixels).

dx

numeric spacing between color-swatches (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

1

ijlyttle/splattr documentation built on Sept. 14, 2020, 12:04 a.m.