Session Ready
Exercise

Add colours to your plot: color input

The colourpicker package provides a color input, available through the colourInput() function. Even though color inputs are not part of the shiny package, they behave in the same way as any other input.

A color input can have many different arguments you can explore, but we will only use the basic arguments: inputId, label, and value. The value argument accepts a color to use as the initial value. Colours can be specified in several different formats, but the easiest one is to simply use English color names such as "red" or "yellow".

Instructions
100 XP

The code for the Shiny app from the last exercise is provided. Your task is to replace the radio buttons that are used to select a color with a color input. Specifically:

  • Load the colourpicker package.
  • Find the UI function that creates the radio buttons that are used for selecting a colour, and replace it with a color input (line 12).
  • The color input should have ID "color", a label of "Point color", and a default color of "blue".