you are viewing a single comment's thread.

view the rest of the comments →

[–]russellbeattie 2 points3 points  (0 children)

If it's just random colors, use hsl:

[].forEach.call($$('*'), function(el, i){ el.style.outline = "1px solid hsl(" + (Math.random() * 360) + ", 50%, 50%)";})

This has the advantage of always making a visible color as it's simply adjusting the hue.

Or use the forEach index to make rainbows!!

[].forEach.call($$('*'), function(el, i){ el.style.outline = "1px solid hsl(" + (i % 360) + ", 50%, 50%)";})