colourWidget | R Documentation |
Create a colour picker htmlwidget. This is not terribly useful right now
since you can use the more powerful colourInput
in Shiny apps and Rmarkdown documents, but this gives you an htmlwidget
version of that colour picker.
colourWidget(
value = "white",
showColour = c("both", "text", "background"),
palette = c("square", "limited"),
allowedCols = NULL,
allowTransparent = FALSE,
returnName = FALSE,
closeOnClick = FALSE,
width = "300px",
height = "35px",
elementId = NULL
)
value |
Initial value (can be a colour name or HEX code) |
showColour |
Whether to show the chosen colour as text inside the input, as the background colour of the input, or both (default). |
palette |
The type of colour palette to allow the user to select colours
from. |
allowedCols |
A list of colours that the user can choose from. Only
applicable when |
allowTransparent |
If |
returnName |
If |
closeOnClick |
If |
width |
Custom width for the input field. |
height |
Custom height for the input field. |
elementId |
Use an explicit element ID for the widget (rather than an automatically generated one). |
colourWidget()
colourWidget("red", palette = "limited", allowedCols = c("yellow", "red", "#123ABC"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.