Suppose you have a transparent color in R: "#00BFFF4C". How to find the non-transparant color such that it looks the same on a white background?
Asked
Active
Viewed 49 times
0
-
It will just be 4C/FF times 00, BF and FF, presumably. i.e. #00394C00, approximately. – Andrew Gustar Jul 16 '19 at 08:37
-
remove the last two values from the alpha channel ...i,e, `#00BFFF` ; check `scales::alpha("#00BFFF", 0.3)` – user20650 Jul 16 '19 at 08:39
-
I am sorry user20650, but that is not correct. What you propose gives a darker color than the transparent color. – Ruben Jul 16 '19 at 08:45
-
@AndrewGustar It seems reasonable that it would be like that, but the color you propose doesn't like the transparent color in the question. – Ruben Jul 16 '19 at 08:54
-
@Ruben Ah! Actually, FFFFFF is white, so you need to work backwards, and apply the 4C/FF factor to (FF-00), (FF-BF), etc, and then subtract that from FF again. Can't do that in my head in this cafe, but hopefully that helps! – Andrew Gustar Jul 16 '19 at 09:55
-
Thank you very much, I now also understand how making lighter and darker works with rgb color coding. – Ruben Jul 16 '19 at 11:25