get_display_color: Return the Displayed Color

View source: R/loonGrob.R

get_display_colorR Documentation

Return the Displayed Color

Description

Always reflect the current displayed color.

Usage

get_display_color(color, selected)

Arguments

color

the loon widget color

selected

the selected states

Details

In loon, each element (i.e. point, bin, line) has a "temporary" color and a "permanent" color. If one element is selected, the color is switched to the "temporary" color to highlight it. If the selection state is eliminated, the "permanent" color of this element will be displayed. Our function always gives the "temporary" displayed color.

Value

The color shown on the plot

Examples

if(interactive()) {
  p <- l_plot(1:10)
  p['selected'][c(1,3,5)] <- TRUE

  displayedColor <- get_display_color(p['color'], p['selected'])
  plot(1:10, bg = as_hex6color(displayedColor), pch = 21)
}

loon documentation built on July 9, 2023, 5:48 p.m.