Skip to contents

Extract hexadecimal colors from a color palette

Usage

palette2colors(name, reverse = FALSE)

Arguments

name

The name of color palette from RColorBrewer package

reverse

Whether or not reverse the order of colors

Value

hexadecimal colors

Examples

palette2colors("Reds")
#> [1] "#FFF5F0" "#FEE0D2" "#FCBBA1" "#FC9272" "#FB6A4A" "#EF3B2C" "#CB181D"
#> [8] "#A50F15" "#67000D"