Learn R Programming

GTAPViz (version 1.1.3)

get_color_palette: Print and Visualize Themed Color Palettes

Description

Prints and visualizes predefined color palettes used in GTAPViz. Use `color_tone = "all"` to return a list of callable palette functions.

Usage

get_color_palette(color_tone = NULL, palette_type = "qualitative")

Value

A character vector of hex color codes representing the selected color palette. If `color_tone = "all"`, returns a list of functions, each generating a specific palette. If `color_tone = "list"`, returns a character vector of available palette names.

Arguments

color_tone

Character. Name of the color theme to display (e.g., `"gtap"`, `"winter"`, `"fall"`, or `"all"`).

palette_type

Character. Palette type: `"qualitative"` (default), `"sequential"`, or `"diverging"`.

Author

Pattawee Puangchit

Examples

Run this code
# Get all palettes as callable functions
all_palettes <- get_color_palette("all")
all_palettes$winter()
all_palettes$gtap()

# Visualize specific palettes
get_color_palette("fall", "sequential")
get_color_palette("academic", "diverging")

Run the code above in your browser using DataLab