get_2colour_gradients: Create 2 colour gradient palette Creates a list of colour...

Description Usage Arguments Value

View source: R/colour_scales.R

Description

Create 2 colour gradient palette

Creates a list of colour names (RGB). Generates a palate using two colour gradients and an optional grey neutral colour. Each half of the palette contains different shades of the colour submitted to the function. These are useful where two colour scales in the same palette are needed, e.g. likert type plots. By default, the main colours are shades of blue and orange used in the analysis function colour scheme.

Usage

1
2
3
4
5
6
7
get_2colour_gradients(
  n,
  colour1 = c(0, 69, 86),
  colour2 = c(255, 105, 0),
  mid,
  neutral_mid = TRUE
)

Arguments

n

the number of colours needed

colour1

the first colour in the scale - a numeric vector representing red, green and blue (max 255)

colour2

the last colour in the scale - numeric vector representing red, green and blue (max 255).

mid

the middle value of the scale. If neutral_mid = TRUE this value will be represented in grey. Otherwise, this will be the endpoint of the first colour gradient (e.g. if n=6 and mid=3, there will be three shades of each colour)

neutral_mid

whether the middle of the scale should be represented in grey (logical, TRUE by default)

Value

RGB colours


best-practice-and-impact/CARS2 documentation built on Dec. 19, 2021, 8:47 a.m.