Description Usage Arguments Details Value Examples
modify_pal
modifies alpha transparency of the colors in the palette.
1 | modify_pal(pal, alpha, show.pal = TRUE, title = "", ...)
|
alpha |
a single number or a vector of numbers between 0 and 1. These values define the degree
of transparency of the colors in the palette. If |
show.pal |
logical. Whether to display the modified palette or not. Default to |
title |
a character string giving the title of the displayed palette. |
... |
additional arguments passed to |
An alpha value defines the "transparency", or "opacity" of the color. A value of 0 means completely transparent (i.e., the background will completely “show through”); a value of 1 means completely opaque (i.e., none of the background will “show through”). In short, the lower the alpha value is, the lower "amount" of the color will be.
A vector of hexadecimal color codes with two additional digits defining the degree of transparency.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
library(PalCreatoR)
image_path <- system.file("Mountain.JPG", package = "PalCreatoR")
My_pal <- create_pal(image = image_path,
n = 5,
resize = 0.1,
method = "kmeans",
colorblind = FALSE,
sort = "value",
show.pal = TRUE,
title = "My Palette")
My_new_pal <- modify_pal(pal = My_pal,
alpha = c(0.2, 0.4, 0.6, 0.8, 1.0),
show.pal = TRUE,
title = "My New Palette")
print(My_new_pal)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.