I am working on replicating in a Rmarkdown a report I made in Excel.
In some of the results I have tables with conditional columns with color formatting, from red to green (red for the lowest data and green for the highest data).
Here an example:

I have searched but the closest I found was to do this:
df %>%
kbl() %>%
kable_paper(full_width = F) %>%
column_spec(2, color = "white",
background = spec_color(df$B,begin=0, end = 1,option='D'))

My problem now is that the spec_color() argument only has 5 color maps and none of them go from red to green.
Does anyone know how I could add a colormap for the conditional formatting just like the one I used in Excel?
I am new using Rmarkdowns, thanks.
