Returns a color that would be suitable to be drawn on a surface whose
color is the given surfaceColor. If the surface color is dark, then
the returned color will be light, otherwise it will be dark.
By default, white color will be returned if the surface color is dark,
and black color will be returned if the surface color is light.
Checks if the given color is dark.
This is done by checking if the luminance of the color is less than the
assertionFactor or not. The default value for the assertionFactor is 0.5.
Checks if the given color is light.
This is done by checking if the luminance of the color is greater than the
assertionFactor or not. The default value for the assertionFactor is 0.5.
Returns a random dark color.
The mode can be optionally specified, which has to be either
1 (for one-primary) or 2 (for two-primary). Any other value will
result in a random mode.
Returns a random light color.
The mode can be optionally specified, which has to be either
1 (for one-primary) or 2 (for two-primary). Any other value will
result in a random mode.