Learn R Programming

gghdx (version 0.2.0)

hdx_pal_discrete: HDX color palette (discrete)

Description

As of the 2025 HDX website redesign, hdx_pal_discrete() utilizes the primary, brand, and error hues for up to a 12 element discrete scale. These supersede the original sapphire, mint, and tomato hues, kept available individually via hdx_pal_sapphire(), hdx_pal_mint(), and hdx_pal_tomato() for backwards compatibility. Pass design = "legacy" to instead get the original sapphire/mint/tomato 12 element scale for reports that aren't ready to move to the new look.

Usage

hdx_pal_discrete(design = c("2025", "legacy"))

hdx_pal_sapphire()

hdx_pal_primary()

hdx_pal_brand()

hdx_pal_error()

hdx_pal_tomato()

hdx_pal_mint()

hdx_pal_gray()

Value

A palette function.

Arguments

design

Either "2025" (default), the current HDX visual design, or "legacy", the original pre-2025 12 element scale kept for backwards compatibility. Only used by hdx_pal_discrete().

Details

hdx_pal_primary(), hdx_pal_brand(), and hdx_pal_error() allow for a 4 element discrete scale using only the specified color. These are color ramps with a range from dark, normal (HDX standard), light, and ultra light. hdx_pal_mint(), hdx_pal_tomato(), and hdx_pal_sapphire() provide the same 4 element ramps for the original palette.

See Also

Other color hdx: hdx_color_list, hdx_colors()

Examples

Run this code
hist(mtcars$mpg, col = hdx_pal_discrete()(5))

Run the code above in your browser using DataLab