get_col_gradient: Get color gradient

Description Usage Arguments Value Examples

View source: R/get_col_gradient.R

Description

Get color gradient for a colorRampPalette with n number of colors.

Usage

1
get_col_gradient(colRamp, n = 50)

Arguments

colRamp

colorRampPalette functions object containing colors for palette. Use function get_col_palette() to create.

n

numeric. Number of colors in gradient

Value

A character vector, names of colors (hex).

Examples

1
2
3
4
5
x <- LETTERS[1:6]
# The three lines of code below are equivalent
get_col_gradient(get_col_palette("RdBu"), 100)
get_col_palette("RdBu")(100)
colorRampPalette(RColorBrewer::brewer.pal(9, "RdBu"))(100)

kazeera/kazcolors documentation built on Aug. 19, 2021, 11:04 a.m.