| Title: | Collection of Palettes, Themes, and Theme Components |
|---|---|
| Description: | A collection of palettes, themes, and theme components based on publicly available branding guidelines of various non-governmental organisations, government agencies, and United Nations units. |
| Authors: | Ernest Guevarra [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-4887-4415>) |
| Maintainer: | Ernest Guevarra <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-06-01 07:12:13 UTC |
| Source: | https://github.com/katilingban/paleta |
The function will search the system for availability of any of the Africa
CDC fonts in hierarchical order starting with Univers, then
Din Next Arabic, and then finally Arial. If none of these
are found in the system, the function will return Noto Sans by default or
the user can set which font to use as alternative by specifying alt.
acdc_fonts set_acdc_font(alt = paleta_fonts$paleta_noto)acdc_fonts set_acdc_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the Africa CDC fonts are not available in the system. |
An object of class list of length 3.
A character value for font family to use as Africa CDC font.
acdc_fonts set_acdc_font()acdc_fonts set_acdc_font()
Africa CDC colours
acdc_green acdc_red acdc_gold acdc_white acdc_grey acdc_corporate_green acdc_text acdc_blue acdc_plum acdc_blue_grey acdc_amber acdc_cyan acdc_deep_orange acdc_purple acdc_lime acdc_mauve acdc_pink acdc_tealacdc_green acdc_red acdc_gold acdc_white acdc_grey acdc_corporate_green acdc_text acdc_blue acdc_plum acdc_blue_grey acdc_amber acdc_cyan acdc_deep_orange acdc_purple acdc_lime acdc_mauve acdc_pink acdc_teal
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
acdc_green acdc_red acdc_goldacdc_green acdc_red acdc_gold
Africa CDC palettes
acdc_palettes acdc_brewer_palettesacdc_palettes acdc_brewer_palettes
An object of class list of length 13.
An object of class list of length 17.
acdc_palettes acdc_brewer_palettesacdc_palettes acdc_brewer_palettes
Get named colours vector
get_colour( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE ) get_colours( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE )get_colour( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE ) get_colours( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE )
pattern |
Optional. A character value or vector to use as a search term. Default is NULL in which case all the Oxford colours are returned. |
model |
A character vector of colour model. Can be "rgb", "cmyk", "hex", or "pantone". Default is "hex". |
named |
Logical. Should the output be a named character value or vector? Default is FALSE. |
A character value or vector of colour/s as per model specification.
If named is TRUE, returns a named character value or vector.
get_colours() get_colours(model = "rgb") get_colours(pattern = "orange") get_colours(pattern = c("orange", "brown"), named = TRUE) get_colours(pattern = c("orange", "GREEN", "Blue"))get_colours() get_colours(model = "rgb") get_colours(pattern = "orange") get_colours(pattern = c("orange", "brown"), named = TRUE) get_colours(pattern = c("orange", "GREEN", "Blue"))
The function will search the system for availability of any of the GNC fonts
in hierarchical order starting with Arial, then Calibri Regular, then
Source Sans Pro, and then finally Arial. If none of these are found in
the system, the function will return Noto Sans by default or the user can
set which font to use as alternative by specifying alt.
gnc_fonts set_gnc_font(alt = paleta_fonts$paleta_noto)gnc_fonts set_gnc_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the GNC fonts are not available in the system. |
An object of class list of length 4.
A character value for font family to use as GNC font.
gnc_fonts set_gnc_font()gnc_fonts set_gnc_font()
GNC colours
gnc_green gnc_grey gnc_sage gnc_dark_green gnc_lime gnc_aqua_green gnc_cyan gnc_blue gnc_orange gnc_moss_green gnc_goldgnc_green gnc_grey gnc_sage gnc_dark_green gnc_lime gnc_aqua_green gnc_cyan gnc_blue gnc_orange gnc_moss_green gnc_gold
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
gnc_green gnc_grey gnc_sagegnc_green gnc_grey gnc_sage
GNC palettes
gnc_palettesgnc_palettes
An object of class list of length 13.
gnc_palettesgnc_palettes
NHS colours
nhs_blue nhs_white nhs_dark_blue nhs_bright_blue nhs_light_blue nhs_aqua_blue nhs_black nhs_dark_grey nhs_mid_grey nhs_pale_grey nhs_dark_green nhs_green nhs_light_green nhs_aqua_green nhs_purple nhs_dark_pink nhs_pink nhs_emergency_red nhs_dark_red nhs_orange nhs_warm_yellow nhs_yellownhs_blue nhs_white nhs_dark_blue nhs_bright_blue nhs_light_blue nhs_aqua_blue nhs_black nhs_dark_grey nhs_mid_grey nhs_pale_grey nhs_dark_green nhs_green nhs_light_green nhs_aqua_green nhs_purple nhs_dark_pink nhs_pink nhs_emergency_red nhs_dark_red nhs_orange nhs_warm_yellow nhs_yellow
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
nhs_blue nhs_dark_bluenhs_blue nhs_dark_blue
The function will search the system for availability of any of the NHS
fonts in hierarchical order starting with Frutiger, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt.
nhs_fonts set_nhs_font(alt = paleta_fonts$paleta_noto)nhs_fonts set_nhs_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the NHS fonts are not available in the system. |
An object of class list of length 2.
A character value for font family to use as NHS font.
nhs_fonts set_nhs_font()nhs_fonts set_nhs_font()
NHS palettes
nhs_palettes nhs_brewer_palettesnhs_palettes nhs_brewer_palettes
An object of class list of length 26.
An object of class list of length 23.
nhs_palettes nhs_brewer_palettesnhs_palettes nhs_brewer_palettes
Colours based on visual identity guidelines of various organisations
paleta_colourspaleta_colours
A tibble with 5 fields
| Variable | Description |
| name | Organisation colour name |
| code | Organisation colour code |
| rgb | Three integers for the red, green, blue components of the RGB colour model |
| cmyk | Four integers for the cyan, magenta, yellow, and black components of the CMYK colour model |
| hex | Hexadecimal codes for corresponding colour |
| pantone | Pantone colour name |
paleta_colourspaleta_colours
These functions apply a similar approach used and demonstrated by
ColorBrewer and has been patterned after the
syntax of the RColorBrewer package
paleta_create_sequential(n, org = c("acdc", "nhs"), name) paleta_create_divergent(n, name, org) paleta_create_qualitative(n, name, org) paleta_create_brewer( n, name, org, type = c("sequential", "divergent", "qualitative") )paleta_create_sequential(n, org = c("acdc", "nhs"), name) paleta_create_divergent(n, name, org) paleta_create_qualitative(n, name, org) paleta_create_brewer( n, name, org, type = c("sequential", "divergent", "qualitative") )
n |
Number of colours desired/required. Organisational palettes should have at least 3 colours and up to 9 colours maximum. All colour schemes are derived from an organisation's brand/style guidelines. |
org |
Name of organisation. Currently supports only "acdc" for the Africa CDC colour palettes. |
name |
Name of the organisational palette to use |
type |
A character value for type of palette to use. Can be either "sequential", "divergent", or "qualitative". |
A character vector of desired/required colours with length
equivalent to n
paleta_create_sequential(n = 5, org = "acdc", name = "blues") paleta_create_divergent(n = 5, org = "acdc", name = "rdylgn")paleta_create_sequential(n = 5, org = "acdc", name = "blues") paleta_create_divergent(n = 5, org = "acdc", name = "rdylgn")
Base package fonts
paleta_fontspaleta_fonts
An object of class list of length 3.
paleta_fontspaleta_fonts
Print function for palettes
## S3 method for class 'palette' print(x, ...)## S3 method for class 'palette' print(x, ...)
x |
An object of class |
... |
Additional arguments to print |
The function will search the system for availability of any of the paleta fonts in hierarchical order starting with Roboto Condensed, then Noto Sans, and then Roboto.
set_paleta_font()set_paleta_font()
A character value for font family to use as paleta font.
set_paleta_font()set_paleta_font()
Get shade of colours
shade_colour(hex, p) shade_colours_(hex, p) shade_colours(hex, p, label = FALSE)shade_colour(hex, p) shade_colours_(hex, p) shade_colours(hex, p, label = FALSE)
hex |
A character value or vector of character of values for hex code of colour/s to shade. |
p |
Range from 0 to 1 for proportion to shade the colour/s with. |
label |
Logical. Should the output/s be labelled? Default is FALSE. |
A character value or vector of character values of hex code/s shaded to the desired proportion.
shade_colour(acdc_green, p = 0.2) shade_colours(acdc_palettes$acdc_secondary, p = 0.4)shade_colour(acdc_green, p = 0.2) shade_colours(acdc_palettes$acdc_secondary, p = 0.4)
These are wrappers for theme_paleta() that use colours and fonts from the
Africa CDC visual identity guidelines.
theme_acdc_light( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_text, subtitle_family = base_family, subtitle_colour = acdc_text, caption_colour = acdc_text, axis_title_colour = acdc_text, legend_title_colour = acdc_text, legend_text_colour = acdc_text, grid_col = acdc_gold, grid = TRUE, axis_col = acdc_gold, axis = FALSE, ticks = FALSE ) theme_acdc_dark( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_white, subtitle_family = base_family, subtitle_colour = acdc_white, caption_colour = acdc_white, axis_title_colour = acdc_white, legend_title_colour = acdc_white, legend_text_colour = acdc_white, plot_background_fill = tint_colour(acdc_gold, 0.8), grid_col = acdc_green, grid = TRUE, axis_col = acdc_green, axis = FALSE, ticks = FALSE )theme_acdc_light( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_text, subtitle_family = base_family, subtitle_colour = acdc_text, caption_colour = acdc_text, axis_title_colour = acdc_text, legend_title_colour = acdc_text, legend_text_colour = acdc_text, grid_col = acdc_gold, grid = TRUE, axis_col = acdc_gold, axis = FALSE, ticks = FALSE ) theme_acdc_dark( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_white, subtitle_family = base_family, subtitle_colour = acdc_white, caption_colour = acdc_white, axis_title_colour = acdc_white, legend_title_colour = acdc_white, legend_text_colour = acdc_white, plot_background_fill = tint_colour(acdc_gold, 0.8), grid_col = acdc_green, grid = TRUE, axis_col = acdc_green, axis = FALSE, ticks = FALSE )
base_family |
Base font family using Africa CDC fonts. Default is set
by what Africa CDC font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default is acdc_text. |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is acdc_text. |
caption_colour |
Colour of the caption text. Default is acdc_text. |
axis_title_colour |
Colour of the axis title text. Default is acdc_text. |
legend_title_colour |
Colour of the legend title text. Default is acdc_text. |
legend_text_colour |
Colour of the legend text. Default is acdc_text. |
grid_col |
Grid colour. Default to acdc_gold. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to acdc_gold. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
plot_background_fill |
Fill colour for the plot background. Default is NULL. |
A ggplot2 theme.
The Africa CDC theme is based on the colours from the acdc_palettes. The
primary palette consists of three colours: acdc_palettes$acdc_primary. The
secondary palette consists of eleven colours: acdc_palettes$acdc_secondary.
The Africa CDC theme uses one or up to two fonts from the four fonts prescribed by the Africa CDC visual identity guidelines. These fonts (in hierarchical order of preference) are Univers, Din Next Arabic, and/or Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = acdc_palettes$acdc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_acdc_light() ## End(Not run)## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = acdc_palettes$acdc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_acdc_light() ## End(Not run)
These are wrappers for theme_paleta() that use colours and fonts from the
GNC visual identity guidelines.
These are wrappers for theme_paleta() that use colours and fonts from the
UNICEF visual identity guidelines.
theme_gnc( base_family = set_gnc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = gnc_grey, subtitle_family = base_family, subtitle_colour = gnc_grey, caption_colour = gnc_grey, axis_title_colour = gnc_grey, legend_title_colour = gnc_grey, legend_text_colour = gnc_grey, grid_col = gnc_grey, grid = TRUE, axis_col = gnc_grey, axis = FALSE, ticks = FALSE ) theme_unicef( base_family = set_unicef_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, subtitle_colour = unicef_cool_grey, caption_colour = unicef_cool_grey, axis_title_colour = unicef_cool_grey, legend_title_colour = unicef_cool_grey, legend_text_colour = unicef_cool_grey, grid_col = unicef_warm_grey, grid = TRUE, axis_col = unicef_warm_grey, axis = FALSE, ticks = FALSE )theme_gnc( base_family = set_gnc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = gnc_grey, subtitle_family = base_family, subtitle_colour = gnc_grey, caption_colour = gnc_grey, axis_title_colour = gnc_grey, legend_title_colour = gnc_grey, legend_text_colour = gnc_grey, grid_col = gnc_grey, grid = TRUE, axis_col = gnc_grey, axis = FALSE, ticks = FALSE ) theme_unicef( base_family = set_unicef_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, subtitle_colour = unicef_cool_grey, caption_colour = unicef_cool_grey, axis_title_colour = unicef_cool_grey, legend_title_colour = unicef_cool_grey, legend_text_colour = unicef_cool_grey, grid_col = unicef_warm_grey, grid = TRUE, axis_col = unicef_warm_grey, axis = FALSE, ticks = FALSE )
base_family |
Base font family using UNICEF fonts. Default is set
by what UNICEF font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default is unicef_black. |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is unicef_cool_grey. |
caption_colour |
Colour of the caption text. Default is unicef_cool_grey. |
axis_title_colour |
Colour of the axis title text. Default is unicef_cool_grey. |
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to unicef_warm_grey. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to unicef_warm_grey. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
A ggplot2 theme.
The GNC theme is based on the colours from the gnc_palettes. The
primary palette consists of one colour: gnc_palettes$gnc_primary.
The secondary palette consists of ten colours:
gnc_palettes$gnc_secondary.
The UNICEF theme is based on the colours from the unicef_palettes. The
primary palette consists of one colour: unicef_palettes$unicef_primary.
The secondary palette consists of eleven colours:
unicef_palettes$unicef_secondary.
The GNC theme uses four fonts as prescribed by the GNC visual identity guidelines. These fonts (in hierarchical order of preference) are Arial, Calibri, Source Sans Pro, and Bebas Neue. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
The UNICEF theme uses four fonts as prescribed by the UNICEF visual identity guidelines. These fonts (in hierarchical order of preference) are Univers LT Pro, Arial, Roboto, and Aleo. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = gnc_palettes$gnc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run) ## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = unicef_palettes$unicef_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run)## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = gnc_palettes$gnc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run) ## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = unicef_palettes$unicef_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run)
These are wrappers for theme_paleta() that use colours and fonts from the
NHS visual identity guidelines.
theme_nhs( base_family = set_nhs_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = nhs_blue, subtitle_family = base_family, subtitle_colour = nhs_dark_grey, caption_colour = nhs_dark_grey, axis_title_colour = nhs_dark_grey, legend_title_colour = nhs_dark_grey, legend_text_colour = nhs_dark_grey, grid_col = nhs_mid_grey, grid = TRUE, axis_col = nhs_mid_grey, axis = FALSE, ticks = FALSE )theme_nhs( base_family = set_nhs_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = nhs_blue, subtitle_family = base_family, subtitle_colour = nhs_dark_grey, caption_colour = nhs_dark_grey, axis_title_colour = nhs_dark_grey, legend_title_colour = nhs_dark_grey, legend_text_colour = nhs_dark_grey, grid_col = nhs_mid_grey, grid = TRUE, axis_col = nhs_mid_grey, axis = FALSE, ticks = FALSE )
base_family |
Base font family using NHS fonts. Default is set
by what NHS font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default is nhs_blue. |
subtitle_family |
Font family to use for the plot subtitle. Default is 'base_family“. |
subtitle_colour |
Colour of the subtitle text. Default is nhs_mid_grey. |
caption_colour |
Colour of the caption text. Default is nhs_mid_grey. |
axis_title_colour |
Colour of the axis title text. Default is nhs_mid_grey. |
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to nhs_pale_grey. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to nhs_pale_grey. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
The NHS theme is based on the colours from the nhs_palettes. The
primary palette consists of two colours: nhs_palettes$nhs_primary. The
secondary palette consists of nineteen colours:.
The NHS theme uses two fonts as prescribed by the NHS visual identity guidelines. These fonts (in hierarchical order of preference) are Frutiger and Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = nhs_palettes$nhs_support_greens ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_nhs() ## End(Not run)## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = nhs_palettes$nhs_support_greens ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_nhs() ## End(Not run)
This generic/base ggplot2 theme is the template from which all other themes in the paleta package is built on. This theme is inspired by Bob Rudis' hrbrthemes package drawing heavily on its typography-centric focus.
theme_paleta( base_family = set_paleta_font(), base_size = 11.5, plot_title_family = base_family, plot_title_size = 16, plot_title_face = "bold", plot_title_colour = NULL, plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_colour = NULL, subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_colour = NULL, caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_colour = NULL, axis_title_face = "plain", axis_title_just = "rt", legend_title_family = subtitle_family, legend_title_colour = NULL, legend_text_family = subtitle_family, legend_text_colour = NULL, plot_margin = ggplot2::margin(30, 30, 30, 30), plot_background_fill = NULL, grid_col = NULL, grid = TRUE, axis_col = NULL, axis = FALSE, ticks = FALSE )theme_paleta( base_family = set_paleta_font(), base_size = 11.5, plot_title_family = base_family, plot_title_size = 16, plot_title_face = "bold", plot_title_colour = NULL, plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_colour = NULL, subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_colour = NULL, caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_colour = NULL, axis_title_face = "plain", axis_title_just = "rt", legend_title_family = subtitle_family, legend_title_colour = NULL, legend_text_family = subtitle_family, legend_text_colour = NULL, plot_margin = ggplot2::margin(30, 30, 30, 30), plot_background_fill = NULL, grid_col = NULL, grid = TRUE, axis_col = NULL, axis = FALSE, ticks = FALSE )
base_family |
Base font family using Africa CDC fonts. Default is set
by what Africa CDC font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_size |
Plot title text size in pts. Default is 16. |
plot_title_face |
Font face ("plain", "italic", "bold", "bold.italic") for plot title. Default is "bold". |
plot_title_colour |
Colour of the plot title text. Default
is |
plot_title_margin |
Margin at the bottom of the plot title. Default set at 10. |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_size |
Plot subtitle text size in pts. Default is 12. |
subtitle_face |
Font face ("plain", "italic", "bold", "bold.italic") for plot subtitle. Default is "plain". |
subtitle_colour |
Colour of the subtitle text. Default is NULL to use default ggplot2 colour. |
subtitle_margin |
Margin at the bottom of the plot subtitle. Default set at 15. |
strip_text_family |
Font family to use for the facet label. Default is
|
strip_text_size |
Facet label text size in pts. Default is 12. |
strip_text_face |
Font face ("plain", "italic", "bold", "bold.italic") for facet label. Default is "plain". |
caption_family |
Font family to use for the caption text. Default is
|
caption_size |
Caption text size in pts. Default is 9. |
caption_face |
Font face ("plain", "italic", "bold", "bold.italic") for caption text. Default is "plain". |
caption_colour |
Colour of the caption text. Default is NULL. |
caption_margin |
Margin at the top of the plot caption text. Default is set at 10. |
axis_text_size |
Axis text size in pts. Default is |
axis_title_family |
Font family to use for the axis title. Default is
|
axis_title_size |
Axis title text size in pts. Default is 9. |
axis_title_colour |
Colour of the axis title text. Default is NULL to use default ggplot2 colour. |
axis_title_face |
Font face ("plain", "italic", "bold", "bold.italic") for axis title. Default is "plain". |
axis_title_just |
Axis title font justification, one of "bl" (bottom-left), "m" (middle), "rt" (right-top). Default is "rt". |
legend_title_family |
Font family to use for the legend title. Default
is |
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_family |
Font family to use for the legend text. Default
is |
legend_text_colour |
Colour of the legend text. Default is NULL. |
plot_margin |
Plot margins (specify with |
plot_background_fill |
Fill colour for the plot background. Default is NULL. |
grid_col |
Grid colour. Default to NULL. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to NULL. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
This function uses either of three fonts - Roboto Condensed, Noto Sans, or Roboto (in this specific order) - depending on what is available in the user's system. Roboto Condensed, Noto Sans, and Roboto - all Google fonts - are freely downloadable and easily installed on any system. If any of these fonts is not available in your system, download and install either/all Roboto Condensed, Noto Sans and/or Roboto from Google Fonts.
A ggplot2 theme.
These are wrappers for theme_paleta() that use colours and fonts from the
World Bank visual identity guidelines.
theme_wb( base_family = set_wb_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = wb_blue, subtitle_family = base_family, subtitle_colour = wb_cyan, caption_colour = wb_blue, axis_title_colour = wb_blue, legend_title_colour = wb_blue, legend_text_colour = wb_blue, grid_col = wb_cyan, grid = TRUE, axis_col = wb_cyan, axis = FALSE, ticks = FALSE )theme_wb( base_family = set_wb_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = wb_blue, subtitle_family = base_family, subtitle_colour = wb_cyan, caption_colour = wb_blue, axis_title_colour = wb_blue, legend_title_colour = wb_blue, legend_text_colour = wb_blue, grid_col = wb_cyan, grid = TRUE, axis_col = wb_cyan, axis = FALSE, ticks = FALSE )
base_family |
Base font family using World Bank fonts. Default is set
by what World Bank font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default is wb_blue. |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is wb_cyan. |
caption_colour |
Colour of the caption text. Default is wb_cyan. |
axis_title_colour |
Colour of the axis title text. Default is wb_cyan. |
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to wb_cyan. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to wb_cyan. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
The World Bank theme is based on the colours from the wb_palettes. The
primary palette consists of four colours: wb_palettes$wb_primary. The
secondary palette consists of fourteen colours: wb_palettes$wb_secondary.
The World Bank theme uses two fonts as prescribed by the World Bank visual identity guidelines. These fonts (in hierarchical order of preference) are Andes and Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = wb_palettes$wb_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_wb() ## End(Not run)## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = wb_palettes$wb_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_wb() ## End(Not run)
Get tint of colours
tint_colour(hex, p) tint_colours_(hex, p) tint_colours(hex, p, label = FALSE)tint_colour(hex, p) tint_colours_(hex, p) tint_colours(hex, p, label = FALSE)
hex |
A character value or vector of character of values for hex code of colour/s to tint. |
p |
A numeric value or vector of numeric values for proportion/s (range from 0 to 1) to tint the colour/s with. |
label |
Logical. Should the output/s be labelled? Default is FALSE. |
A character value or vector of character values of hex code/s tinted to the desired proportion.
tint_colour(acdc_green, p = 0.2) tint_colours(acdc_palettes$acdc_secondary, p = 0.4)tint_colour(acdc_green, p = 0.2) tint_colours(acdc_palettes$acdc_secondary, p = 0.4)
UNICEF colours
unicef_blue unicef_green unicef_lime_green unicef_yellow unicef_orange unicef_bright_red unicef_dark_red unicef_purple unicef_warm_grey unicef_cool_grey unicef_black unicef_dark_blueunicef_blue unicef_green unicef_lime_green unicef_yellow unicef_orange unicef_bright_red unicef_dark_red unicef_purple unicef_warm_grey unicef_cool_grey unicef_black unicef_dark_blue
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
unicef_blue unicef_greenunicef_blue unicef_green
The function will search the system for availability of any of the UNICEF
fonts in hierarchical order starting with Andes, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt.
unicef_fonts set_unicef_font(alt = paleta_fonts$paleta_noto)unicef_fonts set_unicef_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the UNICEF fonts are not available in the system. |
An object of class list of length 4.
A character value for font family to use as UNICEF font.
unicef_fonts set_unicef_font()unicef_fonts set_unicef_font()
UNICEF palettes
unicef_palettesunicef_palettes
An object of class list of length 4.
unicef_palettesunicef_palettes
World Bank colours
wb_blue wb_cyan wb_black wb_white wb_bright_orange wb_bright_yellow wb_bright_red wb_light_orange wb_bright_aqua wb_bright_green wb_bright_purple wb_light_aqua wb_dark_red wb_dark_orange wb_brown wb_dark_purple wb_dark_aqua wb_dark_greenwb_blue wb_cyan wb_black wb_white wb_bright_orange wb_bright_yellow wb_bright_red wb_light_orange wb_bright_aqua wb_bright_green wb_bright_purple wb_light_aqua wb_dark_red wb_dark_orange wb_brown wb_dark_purple wb_dark_aqua wb_dark_green
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
wb_blue wb_cyanwb_blue wb_cyan
The function will search the system for availability of any of the World Bank
fonts in hierarchical order starting with Andes, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt.
wb_fonts set_wb_font(alt = paleta_fonts$paleta_noto)wb_fonts set_wb_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the World Bank fonts are not available in the system. |
An object of class list of length 2.
A character value for font family to use as World Bank font.
wb_fonts set_wb_font()wb_fonts set_wb_font()
World Bank palettes
wb_paletteswb_palettes
An object of class list of length 18.
wb_paletteswb_palettes