Closed oganm closed 5 years ago
I agree, this is a pain. ARGB is consistent with Excel. I'll think about adding functions to convert them.
Just realised that it's easy to rgb()
to create an ARGB string, by giving it the A R G B values in that order.
A <- 1; R <- 0.5; G <- 0; B <- 0
rgb(A, R, G, B)
# [1] "#FF800000"
I'll add this trick to the documentation.
Closed by 6947115f5a0550df02ed56b57d3c79ebb61e59d2. Please reopen if you would like something else.
That's nice and simple. Though for people who like to name their arguments and not get confused maybe you can include
argb = function(r, g, b, a, ...){
rgb(a,r,g,b, ...)
}
or
argb = function(a, r, g, b, ...){
rgb(a, r, g, b, ...)
}
The documentation of the
xlsx_cells
function seem to suggest we can usergb
function to convert rgb values to hex strings butrgb
function returns values in RGBA format, having the alpha channel at the end while the output ofxlsx_cells
seems to be ARGB, with alpha channel at the front.Not sure if which form of output is the original intention but it calls for a change in either the documentation or functionality