Well the problem is that I am creating a web application which allows changing the color of the theme from the configuration, and I would like to be able to automatically generate the dark and light variants of said color. Like this page does:
I don't have any code trailer to show, because I can't think of any algorithm to achieve it. your help is greatly appreciated.
I am working with javascript. Although what interests me is knowing the logic that is applied to get its dark and light versions of a color.
If I'm not mistaken, material.io uses the Chroma.js library to generate the dark and light versions of the colors using the
darken()
and methodsbrighten()
.