Learn R Programming

mycolorsTB (version 0.1.1)

tb_palette: Generate n colors from a mycolorsTB palette

Description

Uses color interpolation to create a custom number of colors from a given palette.

Usage

tb_palette(n, palette_name = "classicTB")

Value

A character vector of n hex color codes.

Arguments

n

The number of colors to generate.

palette_name

The name of the palette to use ("mycolors", "classicTB", or "pathogenomics").

Examples

Run this code
# Generate 20 colors from the 'classicTB' palette
my_custom_colors <- tb_palette(20, "classicTB")
plot(1:20, 1:20, col = my_custom_colors, pch = 19, cex = 3)

Run the code above in your browser using DataLab