moj_col: Choosing a colour, its number of data classes and shade

View source: R/moj_col.R

moj_colR Documentation

Choosing a colour, its number of data classes and shade

Description

You can choose between 6 different colours and their shades. This function can be useful for adding colour to your charts.

Usage

moj_col(colour, x, class = 9)

Arguments

colour

Choices of 6 different colours: blue, green, grey, orange, purple and red.

x

Shade of colour, in order from brightest to darkest.

class

Number of data classes (different shades) of the chosen colour. The default number of classes is 9. The number of data classes can only be between 3 and 9

Value

Colour(s)

Examples

moj_col("blue", 2) # gives you colour #deebf7, which is the 2nd brightest of the 9 shades of blue.
moj_col("blue", x = c(5, 7), class = 7) # gives you colours #4292c6 and #084594. These are the 5th
# and last of the 7 shades of blue.
moj_col("orange", x = 1:5, class = 5) # gives you all 5 shades of orange.
c(moj_col("red", x = 5:8), moj_col("purple", x = 6:7, class = 8)) # gives you red colours
# (#fb6a4a, #ef3b2c, #cb181d and #a50f15) and purple colours (#807dba and #6a51a3)


moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.