Data.Colour.CIE

colour-2.3.4: A model for human colour/color perception

Safe Haskell | Safe
Language | Haskell98

Data.Colour.CIE

Contents

- Orphan instances

Description

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

Synopsis

- data Colour a
- cieXYZ :: Fractional a => a -> a -> a -> Colour a
- cieXYZView :: Fractional a => Colour a -> (a, a, a)
- luminance :: Fractional a => Colour a -> a
- toCIEXYZ :: Fractional a => Colour a -> (a, a, a)
- data Chromaticity a
- mkChromaticity :: Fractional a => a -> a -> Chromaticity a
- chromaCoords :: Fractional a => Chromaticity a -> (a, a, a)
- chromaX :: Fractional a => Chromaticity a -> a
- chromaY :: Fractional a => Chromaticity a -> a
- chromaZ :: Fractional a => Chromaticity a -> a
- chromaConvert :: (Fractional b, Real a) => Chromaticity a -> Chromaticity b
- chromaColour :: Fractional a => Chromaticity a -> a -> Colour a
- lightness :: (Ord a, Floating a) => Chromaticity a -> Colour a -> a
- cieLABView :: (Ord a, Floating a) => Chromaticity a -> Colour a -> (a, a, a)
- cieLAB :: (Ord a, Floating a) => Chromaticity a -> a -> a -> a -> Colour a

# Documentation

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

Instances

ColourOps Colour # |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> Colour a -> Colour a # darken :: Num a => a -> Colour a -> Colour a #
AffineSpace Colour # |
Instance details Defined in Data.Colour.Internal Methods affineCombo :: Num a => [(a, Colour a)] -> Colour a -> Colour a #
Eq a => Eq (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods (==) :: Colour a -> Colour a -> Bool # (/=) :: Colour a -> Colour a -> Bool #
(Fractional a, Read a) => Read (Colour a) # |
Instance details Defined in Data.Colour Methods readsPrec :: Int -> ReadS (Colour a) # readList :: ReadS [Colour a] # readPrec :: ReadPrec (Colour a) # readListPrec :: ReadPrec [Colour a] #
(Fractional a, Show a) => Show (Colour a) # |
Instance details Defined in Data.Colour Methods showsPrec :: Int -> Colour a -> ShowS # show :: Colour a -> String # showList :: [Colour a] -> ShowS #
Num a => Semigroup (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods (<>) :: Colour a -> Colour a -> Colour a # sconcat :: NonEmpty (Colour a) -> Colour a # stimes :: Integral b => b -> Colour a -> Colour a #
Num a => Monoid (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods mempty :: Colour a # mappend :: Colour a -> Colour a -> Colour a # mconcat :: [Colour a] -> Colour a #

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

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

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

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

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

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

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

Deprecated: `toCIEXYZ` has been renamed `cieXYZView`

data Chromaticity a #

Instances

AffineSpace Chromaticity # |
Instance details Defined in Data.Colour.CIE Methods affineCombo :: Num a => [(a, Chromaticity a)] -> Chromaticity a -> Chromaticity a #
Eq a => Eq (Chromaticity a) # |
Instance details Defined in Data.Colour.CIE.Chromaticity Methods (==) :: Chromaticity a -> Chromaticity a -> Bool # (/=) :: Chromaticity a -> Chromaticity a -> Bool #
(Fractional a, Read a) => Read (Chromaticity a) # |
Instance details Defined in Data.Colour.CIE.Chromaticity Methods readsPrec :: Int -> ReadS (Chromaticity a) # readList :: ReadS [Chromaticity a] # readPrec :: ReadPrec (Chromaticity a) # readListPrec :: ReadPrec [Chromaticity a] #
(Fractional a, Show a) => Show (Chromaticity a) # |
Instance details Defined in Data.Colour.CIE.Chromaticity Methods showsPrec :: Int -> Chromaticity a -> ShowS # show :: Chromaticity a -> String # showList :: [Chromaticity a] -> ShowS #

mkChromaticity :: Fractional a => a -> a -> Chromaticity a #

Constructs `Chromaticity` from the CIE little x, little y coordinates for the 2° standard (colourimetric) observer.

chromaCoords :: Fractional a => Chromaticity a -> (a, a, a) #

Returns the CIE little x, little y, little z coordinates for the 2° standard (colourimetric) observer.

chromaX :: Fractional a => Chromaticity a -> a #

Returns the CIE little x coordinate for the 2° standard (colourimetric) observer.

chromaY :: Fractional a => Chromaticity a -> a #

Returns the CIE little y coordinate for the 2° standard (colourimetric) observer.

chromaZ :: Fractional a => Chromaticity a -> a #

Returns the CIE little z coordinate for the 2° standard (colourimetric) observer.

chromaConvert :: (Fractional b, Real a) => Chromaticity a -> Chromaticity b #

Change the type used to represent the chromaticity coordinates.

chromaColour #

Arguments

:: Fractional a |
=> Chromaticity a |
-> a | `luminance`
-> Colour a |

Constructs a colour from the given `Chromaticity` and `luminance`.

lightness #

Arguments

:: (Ord a, Floating a) |
=> Chromaticity a | White point
-> Colour a |
-> a |

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

cieLABView #

Arguments

:: (Ord a, Floating a) |
=> Chromaticity a | White point
-> Colour a |
-> (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`.

cieLAB #

Arguments

:: (Ord a, Floating a) |
=> Chromaticity a | White point
-> a | L* coordinate (lightness)
-> a | a* coordinate
-> a | b* coordinate
-> 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

AffineSpace Chromaticity # |
Instance details Methods affineCombo :: Num a => [(a, Chromaticity a)] -> Chromaticity a -> Chromaticity a #