thlColors: Generate THL colour palettes

View source: R/thlColors.R

thlColorsR Documentation

Generate THL colour palettes

Description

This function is deprecated, use palette_thl() instead.

Usage

thlColors(
  n = 1,
  type = "main",
  name = NULL,
  allow.interpolation = FALSE,
  alpha = 1,
  thin = 1
)

Arguments

n

a numerical value describing how many colours

type

a character string describing the type of colour palette. Allowed values are "main" for the THL main colors (8 colors, for printed media), "powerpoint" for the THL powerpoint colors (9 colors, for PowerPoint presentations), "quali" for qualitative palettes, "quanti" for quantitative palettes and "twoway" for twoway quantitative palettes

name

a character string specifying the name of the specific colour palette. Valid values include "line", "bar" and NULL for type "quali", "S1" - "S6" for type "quanti" and "K1" - "K6" for type "twoway" (see examples)

allow.interpolation

a logical TRUE/FALSE whather colour palette interpoation with grDevices::colorRampPalette() should be allowed if n is outside the range of official number of colours in each quantitative or twoway quantitative palettes.

alpha

Amount of transparency, 1 = not transparent, 0 = fully transparent. Recycled.

thin

Amount of lightening, 1 = none, 0 = white.

Author(s)

Salla Toikkanen, Tarja Palosaari, Petteri Mäntymaa

See Also

thlShade, thlColorsDisplay

Examples

## Generate 3 colours from the quantitative colour palette S2
thlColors(n = 3, type = "quanti", name = "S2")

## Generate colours from the THL PowerPoint colour palette S2
thlColors(type = "powerpoint")

## Generate 3 colours from the quantitative colour palette S2 adding 50% transparency
thlColors(n = 3, type = "quanti", name = "S2", alpha = 0.5)

## Generate 3 colours from the main THL color palette
thlColors(n = 3, type = "main")

## Generate all colors from the quantitative color palette S2 by setting n to NULL
thlColors(n = NULL, type = "quanti", name = "S2")

## THL qualitative colours
thlColors(n = 10, type = "quali", name = NULL)

## THL qualitative colours in the order in which they should be used in line plots
thlColors(n = 6, type = "quali", name = "line")

## THL qualitative colours in the order in which they should be used 
## in bar plots when 3 colors are needed
thlColors(n = 3, type = "quali", name = "bar")

## Attempt to generate 11 colours from twoway quantitative palette K1 yields an error
thlColors(n = 11, type = "twoway", name = "K1")

## Allowing interpolation 11 colours can be generated, although not recommended
thlColors(n = 11, type = "twoway", name = "K1", allow.interpolation = TRUE)

THLfi/thlGraphs documentation built on April 23, 2022, 6:53 a.m.