Color Palette Generator
Easy
28
2
68.8% Acceptance
In this lab, your task to is to create JavaScript Functions, to make the Color Pallete Generator functional. The required Markup and the Styling has already been written for you. You can take look at them to understand how the styles are being applied.
Challenge
Your task is to create 5 Div's with .color-block
class when clicking on the #generate
button (already written for you).
To achieve this, you will need to do the following:
- Create the
generateRandomHexCode()
function, which will always return a valid color hexCode of the format#xxxxxx
- Create the
generateColorPalette()
function to create 5 div's withcolor-block
class and set the following propertiesbackground-color
style to the generated random hex code fromgenerateRandomHexCode()
data-color
attribute to the same hexcode (for showing the hex code on hover over the color block) .
All the best!