HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecolour-2.3.6Haskell98

Data.Colour.CIE

Colour operations defined by the International Commission on Illumination (CIE).

  • 2 types
  • 14 values
  • Packagecolour-2.3.6
  • Exports16
  • LanguageHaskell98
  • LicenceMIT
  • SourceCIE.hs
datadata Colour a
#

This type represents the human preception of colour. The a parameter is a numeric type used internally for the representation.

The Monoid instance allows one to add colours, but beware that adding colours can take you out of gamut. Consider using blend whenever possible.

Instances7AffineSpace, ColourOps, Eq, Read, Show, Semigroup, …
valuecieXYZ :: Fractional a => a -> a -> a -> Colour a
#

Construct a Colour from XYZ coordinates for the 2° standard (colourimetric) observer.

valuecieXYZView :: Fractional a => Colour a -> (a, a, a)
#

Returns the XYZ colour coordinates for the 2° standard (colourimetric) observer.

valueluminance :: Fractional a => Colour a -> a
#

Returns the Y colour coordinate (luminance) for the 2° standard (colourimetric) observer.

valuelightness
  1. :: (Ord a, Floating a)
  2. => Chromaticity a

    White point

  3. -> Colour a
  4. -> a
#

Returns the lightness of a colour with respect to a given white point. Lightness is a perceptually uniform measure.

valuecieLABView
  1. :: (Ord a, Floating a)
  2. => Chromaticity a

    White point

  3. -> Colour a
  4. -> (a, a, a)
#

Returns the CIELAB coordinates of a colour, which is a perceptually uniform colour space. The first coordinate is lightness. If you don't know what white point to use, use d65.

valuecieLAB
  1. :: (Ord a, Floating a)
  2. => Chromaticity a

    White point

  3. -> a

    L* coordinate (lightness)

  4. -> a

    a* coordinate

  5. -> a

    b* coordinate

  6. -> Colour a
#

Returns the colour for given CIELAB coordinates, which is a perceptually uniform colour space. If you don't know what white point to use, use d65.

Orphan instances

1 instance