❝小伙伴
❞June
写的配色R包,欢迎大家多多使用并提出宝贵意见。
Genshinpalette
提供了一系列的调色盘,其灵感来源于原神配色
包安装
目前该包仅能从GitHub上进行安装,后期会不断进行优化完善,也请各位多提提建议和意见帮助包的优化改进:
remotes::install_github("Schwarzeneggerjune/Genshinpalette",force = T)
用法
目前该包中仅有三个简单的函数, get_character_name
函数可以获得原神角色的英文名称,可用于后面提取相应角色的主题色。Genshinpalette
函数能够提取对应角色的主题色,由于颜色提取具有一定的随机性,所以目前的配色可能不是太美观后期会进行人工优化更新, display_colors
函数可以简单的展示调色板中的颜色。
char_name=get_character_name(Country = "All")#Country可以是原神中各国家
head(char_name,10)#若出现乱码请检查系统编码格式是否为UTF-8
ALBEDO ALOY AMBER BARBARA BENNETT DIONA DILUC FISCHL KAEYA KLEE
"阿贝多" "埃洛伊" "安柏" "芭芭拉" "班尼特" "迪奥娜" "迪卢克" "菲谢尔" "凯亚" "可莉"
Genshinpalette('BARBARA',#角色名称
6)#所需颜色个数,默认为6
[1] "#2C3350" "#727782" "#9C9997" "#BEB8BA" "#CDC2B9" "#F4EFEA"
display_colors('FISCHL')

library(ggplot2)
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.05, size = 1, span = 1) +
theme_bw()+
scale_color_manual(values = Genshinpalette('JEAN'))

ggplot(
subset(diamonds, carat > 2.3 & depth > 10 & depth < 100),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw()+
scale_fill_manual(values = Genshinpalette('GANYU'))

调色板展示








往期内容
