Learn to make a simple machine learning website which adapts text colour 🖌 according to changeable background contrast.
Are you enthusiastic about machine learning? Are you trying to implement a simple machine learning webpage from scratch?
If yes, then you’re at the perfect place.
Here we will be making a simple webpage that changes the text colour according to the background color, using a simple machine learning library brain.js.
Let’s kick off our excitement with the result itself.
Here is the link to the webpage.
Go to the above link and try changing the RGB values of the slider, you’d notice the auto changing text colour with respect to the background contrast.
This is what we would be building here.
What? You didn’t open that link? You might miss something cool to see, but anyways here are the screenshots for you.
Here is the full source code that you may want to see.
Let’s get into some code.
First off, we would make a simple html file, where we would structure our webpage. We would also be needing simple sliders for R, G, B values.
So the code for index.html would look something like this: