Gradient Generator

Learning Objectives


By completing this challenge you will gain a good understanding of how RGB colour codes and hexadecimal colour codes work and you will apply this understanding to produce a complex algorithm.

Challenge #1

Complete the code below so that it draws 6 additional squares of different colours creating a linear gradient between both the given colours.

This is what the program should display on screen:
gradient
Allow the user to change the colours and make sure your program always create the desired gradient.

Challenge #2


The second challenge is similar to challenge #1, however this time the user will enter colour codes using the hexadecimal code. e.g. #FF0000 for red.
You will need to convert these codes back into RGB code before creating your gradient.


unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: , , ,