在R中生成相同颜色的不同阴影

Generating different shades of the same colour in R

我想生成从浅色调到深色调的不同色调的颜色

colfunc <- colorRampPalette(c("green", "red"))
colfunc(10)

plot(rep(1,10),col=colfunc(10),pch=19,cex=3)

如果我尝试运行这是一种颜色

 colfunc <- colorRampPalette("green")
 colfunc(10)
 [1] "#00FF00" "#00FF00" "#00FF00" "#00FF00" "#00FF00" "#00FF00"
 [7] "#00FF00" "#00FF00" "#00FF00" "#00FF00"

它returns 我的价值观相同。我怎样才能生成单一颜色的不同色调,比如从浅绿色到深绿色?

fc <- colorRampPalette(c("green", "darkgreen"))
plot(rep(1, 10),col = fc(10), pch = 19, cex = 3)

是你需要的吗?