Learn R Programming

SpaCCI (version 1.0.4)

scPalette: Generate a Color Palette

Description

This function generates a color palette. It selects colors from a predefined color space, and if more colors are needed than are available in the predefined set, it generates a palette using color interpolation.

Usage

scPalette(n)

Value

A character vector of colors in hexadecimal format.

Arguments

n

An integer specifying the number of colors needed.

Examples

Run this code
# \donttest{
# Generate a palette with 5 colors
palette <- scPalette(5)
print(palette)

# Generate a palette with 30 colors
large_palette <- scPalette(30)
print(large_palette)
# }

Run the code above in your browser using DataLab