mardi 26 janvier 2021

I call random colors in my js but would avoid a selection

I call random colors in my JS. It's working well.

(this is for a follow cursor that randomly display a color on link)

But some colors are too dark and I would like to avoid them.

   $links.on('mouseenter', function(e){
      var color = '#'+Math.floor(Math.random()*16777215).toString(16);
      var colorString = color;
      $('#whaouu').css('background-color',colorString);
   });

How can I avoid the darkest part of my colors?




Aucun commentaire:

Enregistrer un commentaire