AC-Colour-1.1.4: Efficient RGB colour types.

Data.Colour.Nonlinear

Contents

Description

Support for the "sRGB" colour space.

This colour space is the de facto standard colour space for computer data, unless some more specific colour space is explicitly specified. Unless you know differently, any image data received from the outside world is probably sRGB, and and data output is probably expected to be sRGB.

Unfortunately, sRGB is a non-linear colour space, so it is not feasible to perform arithmetic in it directly. (The sRGB colour space basically standardises the defective non-linear behaviour of obsolete CRT display technology.)

Synopsis

Types

newtype Colour_sRGB Source

Type for holding sRGB colour values (with Double components).

The standard Colour type is for linear RGB values. This type is for sRGB colours, which are non-linear.

Constructors

Colour_sRGB Colour 

newtype Colour8_sRGB Source

Type for holding sRGB colour values (with Word8 components).

The standard Colour8 type is for linear RGB values. This type is for sRGB colours, which are non-linear.

Constructors

Colour8_sRGB Colour8 

Conversions

colour_to_sRGB :: Colour -> Colour_sRGBSource

Convert a linear RGB value into a non-linear sRGB value.

cdemote_sRGB :: Colour_sRGB -> Colour8_sRGBSource

Convert from Double components to Word8 components.

cpromote_sRGB :: Colour8_sRGB -> Colour_sRGBSource

Convert from Word8 components to Double components.

colour_from_sRGB :: Colour_sRGB -> ColourSource

Convert a non-linear sRGB value into a linear RGB value.