Random Color Generator

Because sometimes you just need a handful of different colors.

When developing or testing, I often need to create elements of differing properties. Coming up these attributes, while not difficult, is distracting from the task at hand.

Added to my toolkit, then, are functions like these — methods that take the work out of rote generation. Simply invoking a method spits out as many colors as I need.

I’ve added two variable properties. type toggles betwixt RGBA and hex values, while opacity allows for translucent colors where overlapped elements need to be visible.

  • Click the block below to change it to a random color.
  • Select a color output at right to change the color format.

Color Output

Current background-color:

Le Code