DEV Community

Cover image for Easy Random Color
Zevan Rosser
Zevan Rosser

Posted on

Easy Random Color

One way to generate a random color is to randomize the hue argument of the css hsl. This value is in degrees 0-360 (think colorwheel):

The other arguments can be randomized as well if you need random saturation and lightness… like this:

See more stuff like this over @ Snippet Zone

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay