Take a look at the boilerplate code.
Show on the page the HEX value of the chosen color.
Add an input and a button to the page, and every time the user enters a HEX value on the input and clicks the button, the app sets the color entered on the input field as the chosen color.
When the user clicks the button, if the value on the input field is not a valid HEX color, show an error message informing the user that the value entered is incorrect.
For simplicity reasons, assume that a valid value for an HEX color is a string that starts with a
# and has 7 characters total.
What about if the user selected 2 colors instead of just 1? Could we generate a gradient instead of a solid color in this case? 🤔