Display THL colours

thlColorsDisplay(
  n = 1:12,
  type = "quali",
  name = NULL,
  allow.interpolation = FALSE,
  alpha = 1,
  thin = 1
)

Arguments

n

a numerical value or a vector describing how many colours of the palette should be shown

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.

See also

Author

Salla Toikkanen, Petteri Mäntymaa, Tarja Palosaari

Examples

## show 5 colours from the quantitative colour palette S2
thlColorsDisplay(n = 5, type = "quanti", name = "S2")
#> Warning: 'thlColorsDisplay' is deprecated.
#> Use 'plot_palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")


## show 8 THL main colours with some transparency
thlColorsDisplay(n = 8, type = "main", alpha = 0.8)
#> Warning: 'thlColorsDisplay' is deprecated.
#> Use 'plot_palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")


## show THL qualitative colours
thlColorsDisplay(n = 1:10, type = "quali", name = NULL)
#> Warning: 'thlColorsDisplay' is deprecated.
#> Use 'plot_palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")


## THL qualitative colours in the order in which they should be used in line plots
thlColorsDisplay(n = 1:6, type = "quali", name = "line")
#> Warning: 'thlColorsDisplay' is deprecated.
#> Use 'plot_palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")


## Attempt to generate 11 colours from twoway quantitative palette K1 yields an error
if (FALSE) {
thlColorsDisplay(n = 11, type = "twoway", name = "K1")
}
## Allowing interpolation 11 colours can be generated, although not recommended
thlColorsDisplay(n = c(1,3,5,7,9,11), type = "twoway", name = "K1", allow.interpolation = TRUE)
#> Warning: 'thlColorsDisplay' is deprecated.
#> Use 'plot_palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> Warning: 'thlColors' is deprecated.
#> Use 'palette_thl' instead.
#> See help("Deprecated")
#> 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()