Skip to contents

When one is using a continuous colorscale to visualize data (say log-fold-changes or correlations), it may be useful to create discrete colors from a usually continuous color scale.

Usage

ft_discretize_colorscale(
  color_scale = NULL,
  discrete_locs = c(25, 75),
  show_colors = TRUE
)

Arguments

color_scale

the color scale to take colors from

discrete_locs

where to take them from

show_colors

create a plot showing the continuous and discrete colors

discrete_n

how many colors to take

Value

vector of colors

Examples

if (require("scico")) {
  ft_discretize_colorscale(scico::scico(100, palette = "vanimo", direction = -1),
                           discrete_locs = c(20, 80))
}
#> Loading required package: scico
#> Warning: there is no package called ‘scico’