--- title: "World Bank Colours, Palettes, and Themes" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{World Bank Colours, Palettes, and Themes} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( message = FALSE, warning = FALSE, collapse = TRUE, comment = "#>", dev = "ragg_png" ) ``` ```{r setup, echo = FALSE} library(paleta) library(ggplot2) ``` The World Bank Group (WBG) comprises five global institutions working with a single strategy of achieving the twin goals of ending extreme poverty by 2030 and boosting shared prosperity: * **IBRD** - The International Bank for Reconstruction and Development is the original World Bank institution, providing loans and other assistance primarily to middle-income countries. * **IDA** - The International Development Association is the part of the World Bank that helps the world’s poorest countries, providing concessional loans, grants, and guarantees for programs that boost economic growth, reduce inequality, and improve people’s living conditions. * **IFC** - International Finance Corporation is the largest global development institution focused exclusively on the private sector, helping developing countries achieve sustainable growth by financing investment, mobilizing capital in international financial markets, and providing advisory services to businesses and governments. * **MIGA** - The Multilateral Investment Guarantee Agency promotes foreign direct investment into developing countries. offering political risk insurance (guarantees) to investors and lenders. * **ICSID** - The International Centre for Settlement of Investment Disputes provides international facilities for conciliation and arbitration of investment disputes. ## World Bank Colours The World Bank employs four corporate colours: Blue, Cyan, Black, and White. ```{r wb-primary, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_primary, class = "palette", name = "World Bank Primary Colours") ``` These are complemented by a set of fourteen secondary colours. ```{r wb-secondary, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_secondary, class = "palette", name = "World Bank Secondary Colours") ``` ## World Bank Palettes In addition to the primary and secondary colours, the colours can be grouped into a bright palette and a neutral palette along with tinted palettes for each World Bank colour. ### Bright palette ```{r wb-bright, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_brights, class = "palette", name = "World Bank Bright Palette") ``` ### Neutral palette ```{r wb-neutral, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_neutrals, class = "palette", name = "World Bank Neutral Palette") ``` ### Tinted bright orange palette ```{r wb-bright-oranges, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_oranges, class = "palette", name = "World Bank Bright Oranges Palette") ``` ### Tinted bright yellow palette ```{r wb-bright-yellows, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_yellows, class = "palette", name = "World Bank Bright Yellows Palette") ``` ### Tinted bright red palette ```{r wb-bright-reds, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_reds, class = "palette", name = "World Bank Bright Reds Palette") ``` ### Tinted light orange palette ```{r wb-light-oranges, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_light_oranges, class = "palette", name = "World Bank Light Oranges Palette") ``` ### Tinted bright aqua palette ```{r wb-bright-aquas, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_aquas, class = "palette", name = "World Bank Bright Aquas Palette") ``` ### Tinted bright green palette ```{r wb-bright-greens, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_greens, class = "palette", name = "World Bank Bright Greens Palette") ``` ### Tinted bright purple palette ```{r wb-bright-purples, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_bright_purples, class = "palette", name = "World Bank Bright Purples Palette") ``` ### Tinted light aqua palette ```{r wb-light-aquas, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_light_aquas, class = "palette", name = "World Bank Light Aquas Palette") ``` ### Tinted dark red palette ```{r wb-dark-reds, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_dark_reds, class = "palette", name = "World Bank Dark Reds Palette") ``` ### Tinted dark orange palette ```{r wb-dark-oranges, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_dark_oranges, class = "palette", name = "World Bank Dark Oranges Palette") ``` ### Tinted brown palette ```{r wb-browns, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_browns, class = "palette", name = "World Bank Browns Palette") ``` ### Tinted dark purple palette ```{r wb-dark-purples, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_dark_purples, class = "palette", name = "World Bank Dark Purples Palette") ``` ### Tinted dark aqua palette ```{r wb-dark-aquas, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_dark_aquas, class = "palette", name = "World Bank Dark Aquas Palette") ``` ### Tinted dark green palette ```{r wb-dark-greens, echo = FALSE, fig.align = "center", fig.height = 1} structure(wb_palettes$wb_dark_greens, class = "palette", name = "World Bank Dark Greens Palette") ``` ## World Bank `ggplot2` theme A World Bank `ggplot2` theme function called `theme_wb()` is included in the `paleta` package. Following are examples of how it can be used. ```{r wb-theme-bar, echo = FALSE, fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} ## barplot using theme_wb() 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_brights |> tint_colours(p = 0.4) |> unlist() ) + labs( title = "World Bank Theme", subtitle = "World Bank neutral palette (tinted to 40%)", x = "Engine Shape", y = "Counts" ) + theme_wb(grid = "Y") ``` ```{r wb-theme-scatter, echo = FALSE, fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} ## scatterplot using theme_wb() ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) + geom_point(size = 3) + scale_colour_manual( name = "Cylinders", values = wb_palettes$wb_brights |> tint_colours(p = 0.4) |> unlist() ) + labs( title = "World Bank Theme", subtitle = "World Bank neutral palette (tinted to 40%)", ) + theme_wb(grid = "XY") ```