shiny-view-colors: Create rectangles in HTML to display colors

Description Usage Arguments Value Examples

Description

Create rectangles in HTML to display colors

Usage

1
colors_rect(colors, width = "100%", height = "45px")

Arguments

colors

A vector of colors to visualize

width

The width of the HTML tag, e.g. '400px', or '100%'.

height

The height of the HTML tag, e.g. '400px', or '100%'.

Value

An HTML tag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

if (interactive()) {

library(shiny)
library(colorscale)

ui <- fluidPage(
  tags$h2("Visualizing colors in Shiny"),
  colors_rect(colors = c(
    get_dark_cols("#1D9A6C"),
    "#1D9A6C",
    get_light_cols("#1D9A6C")
  ))
)

server <- function(input, output, session) {

}

shinyApp(ui, server)

}


## End(Not run)

dreamRs/colorscale documentation built on April 17, 2020, 8:38 a.m.