jbkunst / blog-old-distill

Data, Code and Visualization, old version using distill
http://jkunst.com/blog/
10 stars 4 forks source link

Extended valueBox with sparkline - use any color #5

Open BMorseSAW opened 3 years ago

BMorseSAW commented 3 years ago

G'day, This valueBox is excellent. I thought to suggest an improvement that allows a user to use any color instead of only the Shiny validated colours. It only requires one extra line of code, the removal of the validateColors line, and one additional param. The extra param is "background". and here is the extra code in context:

boxContent <- div( class = "small-box", style = paste0("color: ", color, "; background-color: ", background, ";"), div(

and that is it. Now the valueBox can be used within a corporate colour scheme or with whatever colors you want.