knitr::opts_chunk$set( collapse = TRUE, warning = FALSE, message = FALSE, comment = "#>" )
library(ggbrookings)
You can check out all the colors for each palette by running brookings_view_palette('name_of_palette')
. The colors in some of these palettes may still change from feedback and further experimentation. Some examples below:
The brand palette is the default for the scale_brookings_
functions. Use colors from the brand palette whenever possible.
brookings_view_palette('brand1') brookings_view_palette('brand2')
Different shades of the same hue, or of similar hues can be used when the associated values are related.
brookings_view_palette('analogous1') brookings_view_palette('analogous2')
Colors on the opposite ends of the spectrum. Use Brookings Blue with Secondary colors.
brookings_view_palette('contrasting1') brookings_view_palette('contrasting2')
Where applicable, use colors that are associated with certain concepts. For example, semantic3
could show subsets of gender data (female, male and other).
brookings_view_palette('semantic1') brookings_view_palette('semantic2') brookings_view_palette('semantic3')
Shows pros, cons and neutral, or positive, negative and neutral data.
brookings_view_palette('pos_neg1') brookings_view_palette('pos_neg2')
Use red and blue of similar intensity to represent data related to political parties in the US. Yellow in political3 and political4 represents ‘Independent’ category
brookings_view_palette('political1') brookings_view_palette('political2') brookings_view_palette('political3') brookings_view_palette('political4')
Distinguish discrete categories of data that do not have an inherent ordering. This palette uses distinct hues of visually similar brightness and saturation to avoid creating a sense of order or priority. A maximum of 6 categorical colors are provided as it becomes difficult for people to distinguish between hues after 5-8 colors. If more than 6 colors are needed, consider alternative solutions such as grouping some categories or using alternative visual cues.
brookings_view_palette('categorical')
Sequential palettes are used to show an inherent order or variations in numeric values. Light colors typically indicate low values and darker or brighter colors indicate high values.
brookings_view_palette('sequential1')
In addition to variations in lightness, we can also use two distinct hues to give more contrast.
brookings_view_palette('sequential2')
Diverging palettes are useful when dealing with negative and positive values or a range of values that have two extremes with a baseline central value, like zero. The Brookings diverging palette should uses two distinct hues of similar brightness and saturation with a neutral color in the middle. Using a discrete set of colors with evenly distributed gradation can improve clarity of values relative to a continuous palette.
brookings_view_palette('diverging')
A pleasing option using Brookings Blue and accent yellow.
brookings_view_palette('misc')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.