n <- 20
cols <- seq_color('red', 'blue', n = n, direction = 'in-out', colorspace = 'hcl')
cols
grid::grid.rect(x = seq(0, 0.95, length.out = n), width = 0.1,
gp = grid::gpar(fill = cols, col = NA))
Run the code above in your browser using DataLab