zuericolors: Statistik Stadt Zürich Color Palettes | Read-only mirror of https://github.com/StatistikStadtZuerich/zuericolors — Stadt Zürich. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sara Barbara Hänzi (sszhas) 520e0004f5 Merge branch 'fix-gh-action' into 'main'
Fix gh action

See merge request OE-7035/ssz-da/libraries/zueriverse/zuericolors!16
2025-12-22 15:19:12 +00:00
.github commit actual changes in workflow files... additional system dependencies 2025-12-22 15:47:12 +01:00
dev update packages, add required packages to description, add hidden import to include devtools in renv 2024-12-18 13:16:11 +01:00
man add alt text, correct naming of divergent palettes 2025-04-24 13:24:45 +02:00
R add alt text, correct naming of divergent palettes 2025-04-24 13:24:45 +02:00
renv update R and packages 2025-12-18 11:24:13 +01:00
tests test class and not type of return value 2025-12-18 11:15:26 +01:00
.gitignore create gh action for gh pages with usethis 2025-04-25 16:56:39 +02:00
.gitlab-ci.yml adjust pipeline to new template 2025-11-18 07:17:32 +00:00
.Rbuildignore create gh action for gh pages with usethis 2025-04-25 16:56:39 +02:00
.Rprofile update packages, add required packages to description, add hidden import to include devtools in renv 2024-12-18 13:16:11 +01:00
_pkgdown.yml create gh action for gh pages with usethis 2025-04-25 16:56:39 +02:00
DESCRIPTION update roxygen 2025-12-18 11:11:02 +01:00
LICENSE add SSZ as funder, adjust license to MIT 2025-04-23 09:27:59 +02:00
LICENSE.md add SSZ as funder, adjust license to MIT 2025-04-23 09:27:59 +02:00
NAMESPACE replace ggpubr with patchwork, remove scales 2023-03-07 12:04:56 +01:00
NEWS.md bump version, describe changes in news 2025-04-23 11:33:45 +02:00
README.md remove e-mail thingy from readme 2025-04-25 17:13:33 +02:00
renv.lock update R and packages 2025-12-18 11:24:13 +01:00
zuericolors.Rproj Add new logo 2022-11-16 08:15:52 +01:00

Hexagon logo for zuericolors R package

zuericolors

CRAN status R-CMD-check GitLab Pipeline

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:

  • get_zuericolors extracts colors of a specific color palette and puts them into a vector.
  • view_zuericolors prints a specific color palette. Is useful for visual inspection.

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:

  • LightGry #FAFAFA: A light grey scale is included for use in cases where a data background should be shaded out.
  • PaleGry #EAEAEA: A pale grey shade which is used for elements which should be in the background, but shouldn't completely fade out. Currently used as the color of the links in the sankey diagram.
  • Gry #D6D6D6: A grey scale is included for use in cases where a data value should be shaded out. Currently, it is used for the color of inactive lines in the coordinated map and line chart example. At the moment, it has only one value.
  • DimGry #B8B8B8: A dim grey shade used for highlighting elements which are normally grey (sszvis.scaleGry()). Currently, it is used as the highlight color in the bubble map.
  • MedGry #7C7C7C: The medium grey color, as a standalone value.
  • DeepGry #545454: The deep grey color, as a standalone value.
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 qualitative color palette 6 colors qualitative color palette 6 colors qualitative blue-violet-pink color palette 6 colors qualitative green-brown-orange color palette 12 colors bright qualitative color 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 blue color palette 9 colors sequential red color palette 9 colors sequential green color 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-green color 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.