各位,
当将 wesanderson 调色板设置为连续颜色多于预定义颜色数量时,我尝试从 wesanderson 调色板获取颜色十六进制代码。
library(wesanderson)
获取预定义调色板的所有十六进制代码:
wes_palettes
但是,如何获取以下图的十六进制代码:
wes_palette(21, name = "Zissou1", type = "continuous")
尝试
unclass
。
> library('wesanderson')
> pal <- wes_palette(21, name = "Zissou1", type = "continuous")
> unclass(pal)
[1] "#3A9AB2" "#54A5B9" "#6FB2C1" "#80B6BB" "#91BAB6" "#9BBDAC" "#A5C2A3" "#B1C492" "#BDC881"
[10] "#CCC967" "#DCCB4E" "#DFC12F" "#E3B710" "#E4A70A" "#E79805" "#E98905" "#EC7A05" "#ED6803"
[19] "#EF5703" "#F03801" "#F11B00"
attr(,"name")
[1] "Zissou1"