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.RGBSpace

An RGBSpace is characterized by Chromaticity for red, green, and blue, the Chromaticity of the white point, and it's TransferFunction.

  • 5 types
  • 15 values
  • Packagecolour-2.3.6
  • Exports20
  • LanguageHaskell98
  • LicenceMIT
  • SourceRGBSpace.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, …

RGB Tuple

3 declarations
datadata RGB a
#

An RGB triple for an unspecified colour space.

Constructors

Instances5Functor, Applicative, Eq, Read, Show
  • Functor RGBDefined in colour-2.3.6 · Data.Colour.RGB
  • Applicative RGBDefined in colour-2.3.6 · Data.Colour.RGB
  • Eq a => Eq (RGB a)Defined in colour-2.3.6 · Data.Colour.RGB
  • Read a => Read (RGB a)Defined in colour-2.3.6 · Data.Colour.RGB
  • Show a => Show (RGB a)Defined in colour-2.3.6 · Data.Colour.RGB
valueuncurryRGB :: (a -> a -> a -> b) -> RGB a -> b
#

Uncurries a function expecting three r, g, b parameters.

valuecurryRGB :: (RGB a -> b) -> a -> a -> a -> b
#

Curries a function expecting one RGB parameter.

RGB Gamut

5 declarations
datadata RGBGamut
#

An RGBGamut is a 3-D colour “cube” that contains all the colours that can be displayed by a RGB device. The “cube” is normalized so that white has luminance 1.

Instances3Eq, Read, Show

RGB Space

11 declarations
datadata TransferFunction a
#

A transfer function is a function that typically translates linear colour space coordinates into non-linear coordinates. The transferInverse function reverses this by translating non-linear colour space coordinates into linear coordinates. It is required that

transfer . transferInverse === id === transferInverse . inverse

(or that this law holds up to floating point rounding errors).

We also require that transfer is approximately (**transferGamma) (and hence transferInverse is approximately (**(recip transferGamma))). The value transferGamma is for informational purposes only, so there is no bound on how good this approximation needs to be.

Constructors

Instances2Semigroup, Monoid