prizm-1.1.0: Color transformations in different color spaces
Data.Prizm.Color.SRGB
Contents
Description
Transformation functions and convenience functions to do the base conversion between SRGB and CIEXYZ.
RGB
CIEXYZ
Synopsis
clamp :: Integral a => a -> a Source #
Clamp a Word8 with an upper-bound of 255 (the maximum RGB value).
Word8
parse :: Text -> RGB Source #
Parse a Hex into an sRGB type.
Hex
showRGB :: RGB -> Hex Source #
Show a colour in hexadecimal form, e.g. #00aaff
#00aaff
toXYZMatrix :: RGBtoXYZ -> RGB -> CIEXYZ Source #
Convert an sRGB value to a CIEXYZ given a pre-calculated illuminant matrix.
transform :: Integer -> Double Source #
Transform an RGB integer to be computed against a matrix.
Methods
white :: RGB Source #
black :: RGB Source #
safeConvert :: RGB -> ConvertResult CIEXYZ #
safeConvert :: RGB -> ConvertResult Hex #
safeConvert :: Hex -> ConvertResult RGB #