Skip to contents

This function takes a color palette and returns a data frame containing the color names and their corresponding hex values. If the palette has named colors, the data frame will include these names and ensure the correct order. If the palette is unnamed, it will generate a sequence of numbers to label the colors.

Usage

ro_show_colors_get_df(palette)

Arguments

palette

A named character vector of hex color codes.

Value

A tibble (data frame) with columns number, name and hex.

Examples

ROvis.utils:::ro_show_colors_get_df(c(red = "#FF0000", green = "#00FF00", blue = "#0000FF"))
#> # A tibble: 3 × 3
#>   number name  hex    
#>   <chr>  <chr> <chr>  
#> 1 1      red   #FF0000
#> 2 2      green #00FF00
#> 3 3      blue  #0000FF
ROvis.utils:::ro_show_colors_get_df(c("1" = ro_color("donkerblauw"), "2" = ro_color("robijnrood"),
 "3" = ro_color("mintgroen")))
#> # A tibble: 3 × 3
#>   number name  hex    
#>   <chr>  <chr> <chr>  
#> 1 1      1     #01689b
#> 2 2      2     #ca005d
#> 3 3      3     #76d2b6