js random colors + comments
This commit is contained in:
parent
fea60e8cbd
commit
e55d00a0a5
@ -133,9 +133,14 @@ for (let i = 0; i < nbr_rond; i++) {
|
|||||||
// en hsl
|
// en hsl
|
||||||
// https://developer.mozilla.org/fr/docs/Web/CSS/color_value/hsl
|
// https://developer.mozilla.org/fr/docs/Web/CSS/color_value/hsl
|
||||||
// 'hsl()'
|
// 'hsl()'
|
||||||
let h = Math.random()*360;
|
// h -> teinte, entre 0° et 360°
|
||||||
let s = 30 + Math.random()*20;
|
//https://www.devenir-webmaster.com/V2/TUTO/CHAPITRE/HTML-CSS/07-color/img/cercle-colorimetrique.gif
|
||||||
|
let h = Math.random()*60;
|
||||||
|
// s -> saturation entre 0% et 100%
|
||||||
|
let s = 80 + Math.random()*20;
|
||||||
|
// l -> luminosité entre 0% et 100%
|
||||||
let l = 40 + Math.random()*20;
|
let l = 40 + Math.random()*20;
|
||||||
|
|
||||||
monrond.style.backgroundColor = `hsl(${h},${s}%,${l}%)`;
|
monrond.style.backgroundColor = `hsl(${h},${s}%,${l}%)`;
|
||||||
|
|
||||||
body.append(monrond);
|
body.append(monrond);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user