| Title: | 270 'NCL' Color Tables in R Language |
|---|---|
| Description: | 'NCL' (NCAR Command Language) is one of the most popular spatial data mapping tools in meteorology studies, due to its beautiful output figures with plenty of color palettes designed by experts <https://www.ncl.ucar.edu/index.shtml>. Here we translate all 'NCL' color palettes into R hexadecimal RGB colors and provide color selection function, which will help users make a beautiful figure. |
| Authors: | Dongdong Kong [aut, cre] (ORCID: <https://orcid.org/0000-0003-1836-8172>) |
| Maintainer: | Dongdong Kong <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-06-06 07:27:07 UTC |
| Source: | https://github.com/rpkgs/rcolors |
col2hex
col2hex(col = "grey80")col2hex(col = "grey80")
col |
character, color name |
character, hex color
col2hex("grey80")col2hex("grey80")
Get and interpolate colors
get_color(col, n = NULL, show = FALSE)get_color(col, n = NULL, show = FALSE)
col |
color name in the |
n |
Integer, default is length of |
show |
Boolean, whether to visualize those colors? |
supported col names: 270 ncl colors (names(rcolors)) and 35
RColorBrewer colors (names(colors_group$brewer)).
A character vector with elements of 7 or 9 characters, "#"
followed by the red, blue, green and optionally alpha values in
hexadecimal (after rescaling to 0 ... 255). The optional alpha
values range from 0 (fully transparent) to 255 (opaque).
R does not use ‘premultiplied alpha’.
print(names(rcolors[1:6])) print(names(colors_group$brewer)) get_color("amwg_blueyellowred", n = 20)print(names(rcolors[1:6])) print(names(colors_group$brewer)) get_color("amwg_blueyellowred", n = 20)
Show list of colors
show_cols: show list of colors
show_cols_brewer: show list of colors in RColorBrewer style
show_cols(colors_list, margin = 8, fontsize = 1, family = NULL) show_cols_brewer(colors_list) show_col(colors, labels = TRUE, borders = NULL, cex_label = 1, nrow = NULL)show_cols(colors_list, margin = 8, fontsize = 1, family = NULL) show_cols_brewer(colors_list) show_col(colors, labels = TRUE, borders = NULL, cex_label = 1, nrow = NULL)
colors_list |
A list objects filled with colors_list or a color vector |
margin |
margin in the left |
family, fontsize
|
font family and size of color names in the left |
colors |
a character vector of colors |
labels |
boolean, whether to show the hexadecimal representation of the colours in each tile |
borders |
colour of the borders of the tiles |
cex_label |
size of printed labels, works the same as cex parameter of |
nrow |
integer, number of rows |
print(names(colors_group)) show_cols(colors_group$rainbow, margin = 14)print(names(colors_group)) show_cols(colors_group$rainbow, margin = 14)