Learn R Programming

thisplot (version 0.3.1)

simple_colors: Simple random color selection

Description

Randomly select a specified number of colors from ChineseColors or other palettes.

Usage

simple_colors(n = 10, palette = NULL)

Value

A character vector of hexadecimal color codes.

Arguments

n

The number of colors to return. Default is 10.

palette

The name of the palette to use. If NULL (default), colors will be selected from ChineseColors. Otherwise, colors will be selected from the specified palette. Available palette names can be queried with show_palettes.

Examples

Run this code
simple_colors()

show_palettes(simple_colors(n = 5))

# Get colors from a specific palette
simple_colors(n = 10, palette = "Paired")
simple_colors(n = 10, palette = "ChineseBlue")
simple_colors(n = 10, palette = "Spectral")

Run the code above in your browser using DataLab