Get Random Hex Color

Generate a random hexadecimal color.

CategoryRandom
AuthorPol Gubau
Since1.0.0
Last Updated2025-03-17
TypeSync
CompatibilityBrowser

Example

  • Input

    getRandomHexColor()

    Output:

    "#a3f4b2"

Return

A random hex color string.

Type: string

Notes

Generated colors are always 6-digit hex codes.

Tags

  • random
  • color
  • hex

Related