Open padpadpadpad opened 8 months ago
Hi @padpadpadpad Thank you for sharing this. I really like what you did with the colours! I'm actually in the process of collaborating with @xx02al to get the code up to speed with new developments, so happy to look into this for the next version of the package!
Hi @padpadpadpad. I recommend using the farver package for modifying colour space channels in hex-encoded colour strings. Here's an example considering what you attempted to do. Sidenote: since I am not able to reproduce your example, you might check whether you need to set value
0.3 or 0.7 in the example you provided.
colours <- c("#200630", "#601390", "#A020F0", "#C679F6", "#ECD2FC")
farver::set_channel(colours, "alpha", 0.3)
Hi!
Super cool package. I used it to extract hex codes for transparent values of a whole palette to use as different layers of a ggplot2, as the colours represent different levels of data (see below).
To do this I passed a colour palette in hex codes to hex_to_rgb() then used rgba_to_hex() with an alpha value to get the new colour palette. However hex_to_rgb() currently returns the string "r = X, g = Y, b = Z", when a vector of the three colours would be more useful maybe?
My code and function are here: