r shinydashboard 包中的自定义颜色

Custom colors in r shinydashboard package

我想知道是否有一些技巧可以通过 shinydashboard 包自定义颜色?


documentation 所示,只有少量颜色可供选择。我仍然想知道(并希望)有一些技巧可以自定义该调色板,最好使用 RGB 颜色(如 #123456)。

有这样的魔术吗?或者是否有另一个类似于 shinydashboard 的包,允许自定义颜色?

library(fresh) 允许对 library(shinydashboard)library(shinydashboardPlus) 进行这种程度的自定义(方便的方式):

library(shiny)
library(shinydashboard)
library(fresh)

mytheme <- create_theme(
  adminlte_color(
    light_blue = "#434C5E"
  ),
  adminlte_sidebar(
    width = "400px",
    dark_bg = "#D8DEE9",
    dark_hover_bg = "#81A1C1",
    dark_color = "#2E3440"
  ),
  adminlte_global(
    content_bg = "#FFF",
    box_bg = "#D8DEE9", 
    info_box_bg = "#D8DEE9"
  )
)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    use_theme(mytheme)
  )
)

server <- function(input, output) { }

shinyApp(ui, server)

另请参阅此 related article