WLJS LogoWLJS Notebook

RandomColor

RandomColor[] gives a pseudorandom color directive in the RGBColor space. RandomColor[n] gives n pseudorandom colors.

Examples

Generate a random color:

RandomColor[]
(* RGBColor[0.372, 0.827, 0.153] *)

Generate multiple random colors:

RandomColor[5]
(* {RGBColor[...], RGBColor[...], ...} *)

Generate colors from a specific color scheme:

RandomColor["SunsetColors", 3]
(* {RGBColor[...], ...} *)

Please visit the official Wolfram Language Reference for more details.

On this page