Skip to contents

Used by module Reset buttons. When defaults supplies a mapping for inputId the picker is set back to it; otherwise the widget resets itself to the stock palette it was built with.

Usage

reset_group_colors(session, inputId, defaults, groups, default_palette = NULL)

Arguments

session

The Shiny session object from inside moduleServer().

inputId

Character string — the picker's id, without namespacing.

defaults

A named list of default values, or NULL.

groups

A character vector of the group levels currently in play.

default_palette

A character vector of fallback colors.

Value

Invisibly NULL; called for its side effect.

Author

Jared Andrews

Examples

if (FALSE) { # \dontrun{
# Inside a module's observeEvent(input$reset, ...):
reset_group_colors(session, "palette.colours", defaults, palette_groups(), default_palette_values)
} # }