text

cedwards
·
transparent colors
·
Plain Text
·
Total Size: 492 B
·
·
Created: 3 years ago
·
Edited: 3 years ago
t_col <- function(color, alpha = 1, name = NULL) {
# color = color name
# alpha = fraction of opacity
# name = an optional name for the color
## Get RGB values for named color
rgb.val <- col2rgb(color)
## Make new color using input color as base and alpha set by transparency
t.col <- rgb(rgb.val[1], rgb.val[2], rgb.val[3],
max = 255,
alpha = alpha*255,
names = name)
## Save the color
invisible(t.col)
}
0 bits
•
953 views
Are you sure you want to delete?