Today, I wanted to learn about HTML’s
<canvas> and there was no better way to learn than by writing some code to generate gradients! Link here.
My code also provides rgb values for the intermediate colours if a user clicks on that colour. Please give me feedback and let me know how I can improve my code!
Some ways that I can improve:
- I haven’t done error checking yet (i.e., wrong format, non-alphanumeric values excluding parantheses, etc)
- I can add support for hex values (and figure out how I can change my gradient generator function)
Update: I fixed some issues and added a randomizer button, left my code alone for about half an hour and was pleasantly surprised to see that it was featured on the picked page! I’m over the moon!