Safe Haskell | Safe-Inferred |
---|
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.)
- newtype Colour_sRGB = Colour_sRGB Colour
- newtype Colour8_sRGB = Colour8_sRGB Colour8
- colour_to_sRGB :: Colour -> Colour_sRGB
- cdemote_sRGB :: Colour_sRGB -> Colour8_sRGB
- cpromote_sRGB :: Colour8_sRGB -> Colour_sRGB
- colour_from_sRGB :: Colour_sRGB -> Colour
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 |
Instances
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 |
Instances
Conversions
colour_to_sRGB :: Colour -> Colour_sRGBSource
Convert a linear RGB value into a non-linear sRGB value.
colour_from_sRGB :: Colour_sRGB -> ColourSource
Convert a non-linear sRGB value into a linear RGB value.