prizm-0.3.1.2: Compute with colors and differenct color spaces

Stabilitystable
MaintainerParnell Springmeyer <parnell@ixmat.us>
Safe HaskellSafe-Inferred

Data.Prizm.Color.SRGB

Contents

Description

Transformation functions and convenience functions to do the base conversion between SRGB and CIEXYZ.

Synopsis

Convert to CIEXYZ

toXYZ :: RGB Integer -> CIEXYZ DoubleSource

Convert an SRGB value to a CIEXYZ value.

toXYZMatrix :: RGBtoXYZ -> RGB Integer -> CIEXYZ DoubleSource

Convert an SRGB value to a CIEXYZ given a pre-calculated illuminant matrix.

It is recommended to use toXYZ as it uses the most common illuminant matrix.

Convert to Hex

toHex :: RGB Integer -> HexSource

Convert an SRGB value to Hex.

fromHex :: Hex -> RGB IntegerSource

Convert a Hex to an SRGB.

clamp :: Integer -> IntegerSource

Clamp an integer with an upper-bound of 255 (the maximum RGB value).