Hexagon logo for zuericolors R package

zuericolors

zuericolors is an R-Package, which provides specific colors according to the corporate design of the city of Zurich. The package contains all colors that Statistik Stadt Zürich needs for the creation of graphs. There are two main functions in zuericolors:

For the creation of CI/CD conform ggplot2 graphs see the zueritheme and zueriplots repositories.

Installation

The easiest way to get zuericolors is to install it from this repo:

# install.packages("devtools")
devtools::install_github("StatistikStadtZuerich/zuericolors")

Alternatively, download the files (by clicking 'Clone or download' / 'Download Zip'), extract it to any location on your computer, e.g. to your Desktop and then run:

remotes::install_local("<path_to_location>/zuericolors-main")

Version

To check your version of zuericolors, run:

packageVersion("zuericolors")

Examples

library(zuericolors)

# Get all the colors from palette "qual6"
get_zuericolors("qual6")

[1] "#3431DE" "#DB247D" "#1D942E" "#FBB900" "#23C3F1" "#FF720C"

# Get first color from palette "div9ntrgry"
get_zuericolors("div9ntrgry", nth = 1)

"#A30059"

# Get first four colors from palette "qual12"
get_zuericolors("qual12", nth = 1:4)

[1] "#3431DE" "#0A8DF6" "#23C3F1" "#7B4FB7"

# View color palette "qual12"
view_zuericolors("qual12")
color palette 12 colors qualitative

Usage

Grey Palette

The grey color palette is not a palette in the true sense. However, its individual colors are needed for different features in sszviz:

color palette 6 colors grey

Qualitative Palettes

Qualitative palettes are used for data that has distinct categories. They distinguish categories based on color contrast. They should never be used to compare values, use sequential or divergent palettes in this case.

color palette 12 colors qualitativecolor palette 6 colors qualitativecolor palette 6 colors qualitative blue-violet-pinkcolor palette 6 colors qualitative green-brown-orangecolor palette 12 colors bright qualitativecolor palette 12 colors dark qualitative

Sequential Palettes

Sequential palettes are used to compare values. These palettes are designed to have the same brightness for the same input value.

color palette 9 colors sequential bluecolor palette 9 colors sequential redcolor palette 9 colors sequential greencolor palette 9 colors sequential brown

Divergent Palettes

Divergent palettes are used to compare data that has two extremes. These scales are designed to have the same brightness for the same input value. They come in two color variations: the valued (red-green) variation is used for data that has negative-positive characteristics, the neutral (brown-blue) variation is used in cases where no valuation is wanted.

color palette 9 colors divergent red-greencolor palette 9 colors divergent brown-blue

Palettes for Gender, Origin and Marriage

#349894 is used for women, #FFD736 for men, and #986AD5 for people who identify as non-binary.

color palette 3 colors gender

#349894 is also used for female foreigners (and #00615D for Swiss female), #FFD736 for male foreigners (and #DA9C00 for Swiss male), and #986AD5 for foreigners who identify as non-binary (and #5E359A for Swiss individuals who identify as non-binary).

color palette 6 colors gender and origin

#349894 is used to depict a marriage between two women, and #FFD736 for a marriage between two men. Same-sex marriages, in general, are represented by the color #3431DE. For a marriage between a woman and an alt="color palette 9 colors sequential red"unknown partner, #B8B8B8 is used, while #D6D6D6 is used for a marriage between a man and an unknown partner.

color palette 5 colors gender and marital status

Getting help

If you encounter a bug, please contact statistik@zuerich.ch.