Skip to content

Commit

Permalink
small fixes to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Sep 27, 2017
1 parent c7653d8 commit 0e3d283
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Shiny input, here is an example:

![Demo of colourInput](inst/img/colourinput.png)

Scroll down for [more information about
`colourInput()`](#colourinput-features).

<h2 id="plothelper">
Select colours to use in your plot: `plotHelper()`
</h2>
Expand All @@ -103,6 +106,9 @@ The colours selected will be available as a variable named `CPCOLS`.

![Demo of Plot Colour Helper](inst/img/plothelper-demo.png)

Scroll down for [more information about the Plot Colour
Helper](#plothelper-features).

<h2 id="colourpicker">
Select colours to use in your R code: `colourPicker()`
</h2>
Expand Down Expand Up @@ -150,10 +156,10 @@ value will be returned.

### Allowing transparent colours

A simple colour input allow you to choose any opaque colour. If you use
A simple colour input allows you to choose any opaque colour. If you use
the `allowTransparent = TRUE` parameter, the input will display an
additional slider that lets you choose a transparency (alpha) value.
Using this slider allows you to select semi-transparent colours, of even
Using this slider allows you to select semi-transparent colours, or even
the fully transparent colour, which is sometimes useful.

When using transparent colours, the return value will be an 8-digit HEX
Expand Down Expand Up @@ -226,7 +232,7 @@ can start with a basic colour input such as
`colourInput("col", "Select colour")` and completely redesign it with

updateColourInput(session, "col", label = "COLOUR:", value = "orange",
showColour = "background", allowTransparent = TRUE, transparentText = "None")
showColour = "background", allowTransparent = TRUE)

### Works on any device

Expand Down
8 changes: 6 additions & 2 deletions vignettes/colourpicker.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ shinyApp(

![Demo of colourInput](../inst/img/colourinput.png)

Scroll down for [more information about `colourInput()`](#colourinput-features).

<h2 id="plothelper">Select colours to use in your plot: `plotHelper()`</h2>

If you've ever had to spend a long time perfecting the colour scheme of a plot, you'd find the Plot Colour Helper handy. It's an RStudio addin that lets you interactively choose colours for your plot while updating your plot in real-time, so you can see the colour changes immediately.
Expand All @@ -93,6 +95,8 @@ To use this tool, either highlight code for a plot and select the addin through

![Demo of Plot Colour Helper](../inst/img/plothelper-demo.png)

Scroll down for [more information about the Plot Colour Helper](#plothelper-features).

<h2 id="colourpicker">Select colours to use in your R code: `colourPicker()`</h2>

`colourpicker` also provides a more generic RStudio addin that can be used to select colours and save them as a variable in R. You can either access this tool using the *Addins* menu or with `colourPicker()`. You can also watch a [short GIF](../inst/img/colourPickerGadget.gif) of it an action.
Expand All @@ -116,7 +120,7 @@ If you use the `returnName = TRUE` parameter, then the return value will be a co

### Allowing transparent colours

A simple colour input allow you to choose any opaque colour. If you use the `allowTransparent = TRUE` parameter, the input will display an additional slider that lets you choose a transparency (alpha) value. Using this slider allows you to select semi-transparent colours, of even the fully transparent colour, which is sometimes useful.
A simple colour input allows you to choose any opaque colour. If you use the `allowTransparent = TRUE` parameter, the input will display an additional slider that lets you choose a transparency (alpha) value. Using this slider allows you to select semi-transparent colours, or even the fully transparent colour, which is sometimes useful.

When using transparent colours, the return value will be an 8-digit HEX code instead of 6 digits (the last 2 digits are the transparency value). For example, if you select a 50% transparent red, the return value would be `#FF000080`. Most R plotting functions can accept colours in this format.

Expand Down Expand Up @@ -152,7 +156,7 @@ As with all other Shiny inputs, `colourInput` can be updated with the `updateCol

```
updateColourInput(session, "col", label = "COLOUR:", value = "orange",
showColour = "background", allowTransparent = TRUE, transparentText = "None")
showColour = "background", allowTransparent = TRUE)
```

### Works on any device
Expand Down

0 comments on commit 0e3d283

Please sign in to comment.