modify_pal
modifies alpha transparency of the colors in the palette.
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 |
A vector of hexadecimal color codes with two additional digits defining the degree of transparency.
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.
if (FALSE) { 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)}