Data.Colour.Palette.RandomColor (original) (raw)

Contents

Description

Functions to create random colors. Includes a port of David Merfield's randomColor.

Synopsis

A Library for generating random colors.

Choose a random color from CIELAB colorspace.

randomCIELab :: MonadRandom m => m Kolor Source #

Generate a random color from CIELAB (a perceptually uniform color space) with a White point of [d65](/package/colour-2.3.4/docs/Data-Colour-CIE-Illuminant.html#v:d65). Probably the best choice if you want a totally random color.

randomCIELab

Choose a random color using David Merfield's algorithm

randomColor :: MonadRandom m => Hue -> Luminosity -> m Kolor Source #

Generate a random opaque color.

randomColor HueRed LumBright

randomColor HueOrange LumBright

randomColor HueYellow LumBright

randomColor HueGreen LumBright

randomColor HueBlue LumBright

randomColor HuePurple LumBright

randomColor HuePink LumBright

randomColor HueMonochrome LumRandom

randomColor HueRandom LumLight

randomColor HueRandom LumDark

randomColor HueRandom LumRandom

Better to use [randomCIELab](Data-Colour-Palette-RandomColor.html#v:randomCIELab) for truly random colors.

Choose a random HSV component

randomHue :: MonadRandom m => Hue -> m Int Source #

return a random hue in the range [lo, hi] as a [Double](/package/base-4.10.1.0/docs/Prelude.html#t:Double). lo should be >= 0 and hi < 360. Instead of storing red as two seperate ranges we create a single contiguous range using negative numbers.