Description Usage Arguments Details Note Examples
Create an input control to select a colour, with or without shiny
1 2 3 4 |
label |
Display label for the control, or ' |
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 |
transparentText |
The text to show beside the transparency checkbox
when |
set |
sets the crosstalk group to inform about changes in input value. |
A colour input allows users to select a colour by clicking on the desired
colour, or by entering a valid HEX colour in the input box. The input can
be initialized with either a colour name or a HEX value. The return value is
a HEX value by default, but you can use the returnName = TRUE
parameter
to get an R colour name instead (only when an R colour exists for the
selected colour).
Since most functions in R that accept colours can also accept the value
"transparent", colourInput
has an option to allow selecting the
"transparent" colour. When the user checks the checkbox for this special
colour, the returned value form the input is "transparent".
This function is an adaption of the fabulous colourInput
so that htmlwidgets can take advantage of colour palette changes, without shiny.
1 2 | # TODO: get label working (also height/width!)
colourPalette("hey there", "red", palette = "limited", allowedCols = c("red", "blue"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.