Generate pretty color in Mathematica. Ported from David Merfield's randomColor (f02eede).
Based on PrettyRandomColor, PrettyColorize is a useful tool for customizing the color of your figures in Mathematica.
- Open the Mathematica user application folder by
SystemOpen @ FileNameJoin[{$UserBaseDirectory, "Applications"}];
- Create a folder called
/PrettyRandomColor
and placePrettyRandomColor.wl
and/Kernel
inside.
- Load package using
<< PrettyRandomColor`
. PrettyRandomColor[]
generate one random colorPrettyRandomColor[]
takes the following options:Hue
restricts the generated color, possible values are:Monochrome
,Red
,Orange
,Yellow
,Green
,Blue
,Purple
,Pink
;- String representing hex, e.g., "#ffffff", "#666";
- Integer (0 ~ 360) representing hue value.
ColorCount
specifies the number of random colors to be generated, default to 1.Luminosity
a String specifies the luminosity of the color, can be"Bright"
,"Light"
,"Dark"
.Opacity
a Real (0 ~ 1) specifies the opacity of the color, default to 1.Seed
an Integer or String representing the RNG seed, default toNone
.
Graphics[
Riffle[
PrettyRandomColor[ColorCount -> 200],
Disk[#, 1/40] & /@ RandomReal[{.1, .9}, {200, 2}]
],
PlotRange -> {0, 1},
ImageSize -> 600
]
Specifying Hue
Options:
Other examples: