Data.Colour.Palette.RandomColor (original) (raw)
Contents
Description
Functions to create random colors. Includes a port of David Merfield's randomColor.
Synopsis
- randomCIELab :: MonadRandom m => m Kolor
- randomCIELabPalette :: MonadRandom m => m [Kolor]
- randomColor :: MonadRandom m => Hue -> Luminosity -> m Kolor
- randomPalette :: MonadRandom m => Hue -> Luminosity -> m [Kolor]
- randomHarmony :: MonadRandom m => Kolor -> m [Kolor]
- randomHue :: MonadRandom m => Hue -> m Int
- randomSaturation :: MonadRandom m => Hue -> Luminosity -> m Int
- randomBrightness :: MonadRandom m => Hue -> Luminosity -> Int -> m Int
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.