Learn R Programming

gghdx (version 0.1.4)

hdx_colors: Hex values for HDX colors

Description

hdx_colors() conveniently returns a vector of hex values for specified color ramps. Full values can be found in hdx_color_list. If you know the name of the color you want, such as "sapphire-hdx", you can use hdx_hex(c("sapphire-hdx")) to directly access the hex code.

Usage

hdx_colors(colors = c("sapphire", "mint", "tomato", "gray"))

hdx_colours(colors = c("sapphire", "mint", "tomato", "gray"))

hdx_hex(color_names)

hdx_color_names()

hdx_colour_names()

Value

  • hdx_colors() returns a named vector of hex values.

  • hdx_color_names() returns a character vector of color names.

Arguments

colors

Specified color ramps to return. Some set of "sapphire", "mint", "tomato", and "gray. By default returns all colors.

color_names

Vector of color names. Valid values are all available using hdx_colors

Details

All valid color names are in the named vector returned by hdx_colors() or accessible in the convenient hdx_color_names().

See Also

Other color hdx: hdx_color_list, hdx_pal_discrete()

Examples

Run this code
# get hex values
hdx_colors()
hdx_colors("sapphire")

# get color names
hdx_color_names()

Run the code above in your browser using DataLab