grepal("cyan")
# With regular expressions:
some_grey <- grepal("gr(a|e)y")
start_grey <- grepal("^gr(a|e)y")
only_grey <- grepal("^gr(a|e)y$")
length(some_grey)
length(only_grey)
# With other color objects (df as x):
grepal("blau", x = pal_unikn)
grepal("SEE", x = pal_unikn_pref)
# Applications:
seecol(grepal("white"), col_bg = "lightblue2", title = "See 'white' colors()")
olives <- grepal("olive")
oranges <- grepal("orange")
seecol(list(olives, oranges),
pal_names = c("olives", "oranges"),
title = "Comparing olives and oranges")
seecol(grepal("SEE", pal_unikn), title = "All 'SEE' colors in pal_unikn")
seecol(grepal("blau", pal_unikn_pref), title = "All 'blau' colors in pal_unikn_pref")
Run the code above in your browser using DataLab