colour-2.3.6: A model for human colour/color perception
Safe Haskell Safe-Inferred
Language Haskell98

Data.Colour.RGBSpace

Description

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

Synopsis

Documentation

data Colour a Source #

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.

Instances

Instances details
ColourOps Colour Source #
Instance details

Defined in Data.Colour.Internal

AffineSpace Colour Source #
Instance details

Defined in Data.Colour.Internal

Eq a => Eq ( Colour a) Source #
Instance details

Defined in Data.Colour.Internal

( Fractional a, Read a) => Read ( Colour a) Source #
Instance details

Defined in Data.Colour

( Fractional a, Show a) => Show ( Colour a) Source #
Instance details

Defined in Data.Colour

Num a => Semigroup ( Colour a) Source #
Instance details

Defined in Data.Colour.Internal

Num a => Monoid ( Colour a) Source #
Instance details

Defined in Data.Colour.Internal

RGB Tuple

uncurryRGB :: (a -> a -> a -> b) -> RGB a -> b Source #

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

curryRGB :: ( RGB a -> b) -> a -> a -> a -> b Source #

Curries a function expecting one RGB parameter.

RGB Gamut

mkRGBGamut Source #

Arguments

:: RGB ( Chromaticity Rational )

The three primaries

-> Chromaticity Rational

The white point

-> RGBGamut

An RGB gamut is specified by three primary colours (red, green, and blue) and a white point (often d65 ).

inGamut :: ( Ord a, Fractional a) => RGBGamut -> Colour a -> Bool Source #

Returns True if the given colour lies inside the given gamut.

RGB Space

data TransferFunction a Source #

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

TransferFunction

Fields

data RGBSpace a Source #

An RGBSpace is a colour coordinate system for colours laying inGamut of gamut . Linear coordinates are passed through a transferFunction to produce non-linear RGB values.

linearRGBSpace :: Num a => RGBGamut -> RGBSpace a Source #

Produce a linear colour space from an RGBGamut .

rgbUsingSpace :: Fractional a => RGBSpace a -> a -> a -> a -> Colour a Source #

Create a Colour from red, green, and blue coordinates given in a general RGBSpace .

toRGBUsingSpace :: Fractional a => RGBSpace a -> Colour a -> RGB a Source #

Return the coordinates of a given Colour for a general RGBSpace .