This function is deprecated, use palette_thl() instead.

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

Salla Toikkanen, Tarja Palosaari, Petteri Mäntymaa

Examples

## Generate 3 colours from the quantitative colour palette S2
thlColors(n = 3, type = "quanti", name = "S2")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#2F62ADFF" "#BEC3BCFF" "#FCE4C3FF"

## Generate colours from the THL PowerPoint colour palette S2
thlColors(type = "powerpoint")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#7BC143FF"

## Generate 3 colours from the quantitative colour palette S2 adding 50% transparency
thlColors(n = 3, type = "quanti", name = "S2", alpha = 0.5)
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#2F62AD80" "#BEC3BC80" "#FCE4C380"

## Generate 3 colours from the main THL color palette
thlColors(n = 3, type = "main")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#7BC143FF" "#807F83FF" "#6BC9C7FF"

## Generate all colors from the quantitative color palette S2 by setting n to NULL
thlColors(n = NULL, type = "quanti", name = "S2")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#2F62ADFF" "#337AACFF" "#6594B2FF" "#98AFB7FF" "#CAC9BDFF" "#E7D9C1FF"
#> [7] "#FCE4C3FF"

## THL qualitative colours
thlColors(n = 10, type = "quali", name = NULL)
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#>  [1] "#2F62ADFF" "#BE3F72FF" "#519B2FFF" "#29A0C1FF" "#CC77ACFF" "#FAA61AFF"
#>  [7] "#7BC143FF" "#606060FF" "#C3C2C6FF" "#DCDFE2FF"

## THL qualitative colours in the order in which they should be used in line plots
thlColors(n = 6, type = "quali", name = "line")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#519B2FFF" "#2F62ADFF" "#BE3F72FF" "#29A0C1FF" "#FAA61AFF" "#CC77ACFF"

## 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")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> [1] "#519B2FFF" "#2F62ADFF" "#FAA61AFF"

## Attempt to generate 11 colours from twoway quantitative palette K1 yields an error
thlColors(n = 11, type = "twoway", name = "K1")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: The official palette K1 has either 1, 3, 5, 7 or 9 colors
#> NULL

## Allowing interpolation 11 colours can be generated, although not recommended
thlColors(n = 11, type = "twoway", name = "K1", allow.interpolation = TRUE)
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: The official palette K1 has either 1, 3, 5, 7 or 9 colors, now palette generated with grDevices::colorRampPalette()
#>  [1] "#2F62ADFF" "#517BB7FF" "#7494C2FF" "#96ADCCFF" "#B9C6D7FF" "#DCDFE2FF"
#>  [7] "#D6BECBFF" "#D09EB5FF" "#CA7E9EFF" "#C45F88FF" "#BE3F72FF"