library(ezfun)
library(ggplot2)

Introduction

This vignette gives a short example on usage of the ccf_color_palette functionality. The goal of the ccf_color_palette functions is to give users access to Cleveland Clinic brand colors for use in plotting with ggplot2.

The code behind this color palette is largely based on the code from the Wes Anderson color palettes for R: https://github.com/karthik/wesanderson and a previous brand color palette I created at Memorial Sloan Kettering Cancer Center.

Palettes

There are six color palettes available.

You can view a list of the color names and hex codes for a specific color palette:

And you can also view the colors in a plot window.

main

The main color palette is based on the primary and seconary CCF brand colors.

ccf_palette("main")

bright

The bright color palette is based on the bright supplemental CCF brand colors.

ccf_palette("bright")

neutral

The neutral color palette is based on the neutral supplemental CCF brand colors.

ccf_palette("neutral")

all

The all color palette contains all colors from main, bright, and neutral for when a large number of colors are needed.

blues

The blues color palette only contains two colors and is meant to be used for continuous color scales where interpolation will be done between the high and low color.

ccf_palette("blues")

greens

Similarly, the greens color palette only contains two colors and is meant to be used for continuous color scales where interpolation will be done between the high and low color.

ccf_palette("greens")

Plotting

Functionality is available to plot single or multiple colors, discrete color scales, and continuous color scales.

To use a single specific color, simply reference it by name.

You can do the same to use multiple specific colors using scale_color_manual.

To use the palettes, specify a palette by name as the values argument to scale_color_manual or scale_fill_manual.

You can also pick and choose which colors you want by position in the palette.

The scale_color_gradientn function can be used to add colors on a continuous scale, by adding the option type = "continuous" to ccf_palette(). Interpolation between colors in the palette will be done to create a continuous scale, and this is intended for use with the blues and greens palettes.