View source: R/thlColorsDisplay.R
thlColorsDisplay | R Documentation |
Display THL colours
thlColorsDisplay( n = 1:12, type = "quali", name = NULL, allow.interpolation = FALSE, alpha = 1, thin = 1 )
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. |
Salla Toikkanen, Petteri Mäntymaa, Tarja Palosaari
thlColors
, thlShade
## show 5 colours from the quantitative colour palette S2 thlColorsDisplay(n = 5, type = "quanti", name = "S2") ## show 8 THL main colours with some transparency thlColorsDisplay(n = 8, type = "main", alpha = 0.8) ## show THL qualitative colours thlColorsDisplay(n = 1:10, type = "quali", name = NULL) ## THL qualitative colours in the order in which they should be used in line plots thlColorsDisplay(n = 1:6, type = "quali", name = "line") ## Attempt to generate 11 colours from twoway quantitative palette K1 yields an error ## Not run: thlColorsDisplay(n = 11, type = "twoway", name = "K1") ## End(Not run) ## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.