Learn R Programming

pliman (version 2.1.0)

custom_palette: Generate Custom Color Palette

Description

This function generates a custom color palette using the specified colors and number of colors.

Usage

custom_palette(
  colors = c("#4B0055", "#00588B", "#009B95", "#53CC67", "yellow"),
  n = 100
)

Value

A vector of colors representing the custom color palette.

Arguments

colors

A vector of colors to create the color palette. Default is c("steelblue", "salmon", "forestgreen").

n

The number of gradient colors in the color palette. Default is 100.

Examples

Run this code
# Generate a custom color palette with default colors and 10 colors
custom_palette()

# Generate a custom color palette with specified colors and 20 colors
custom_palette(colors = c("blue", "red"), n = 20)

# example code
library(pliman)
custom_palette(n = 5)

Run the code above in your browser using DataLab