Copyright | (c) Alexey Kuleshevich 2019-2020 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Constructors for a sRGB color space.
pattern ColorSRGB :: e -> e -> e -> Color (SRGB l) e Source #
Constructor for a color in sRGB
color space
Since: 0.1.0
pattern ColorSRGBA :: e -> e -> e -> e -> Color (Alpha (SRGB l)) e Source #
Constructor for a color in sRGB
color space with alphs channel
Since: 0.1.0
data SRGB (l :: Linearity) Source #
The most common sRGB color space, which is defined with:
D65
illuminant- Transfer function:
\[ \gamma(u) = \begin{cases} 12.92 u & u \leq 0.0031308 \\ 1.055 u^{1/2.4} - 0.055 & \text{otherwise} \end{cases} \]
- Inverse transfer function
\[ \gamma^{-1}(u) = \begin{cases} u / 12.92 & u \leq 0.04045 \\ \left(\tfrac{u + 0.055}{1.055}\right)^{2.4} & \text{otherwise} \end{cases} \]
- Normalized primary matrix:
>>>
:set -XDataKinds
>>>
import Graphics.Color.Space.RGB
>>>
npm :: NPM SRGB Float
[ [ 0.41240000, 0.35760000, 0.18050000 ] , [ 0.21260000, 0.71520000, 0.07220000 ] , [ 0.01930000, 0.11920000, 0.95050000 ] ]
- Inverse normalized primary matrix:
>>>
:set -XDataKinds
>>>
import Graphics.Color.Space.RGB
>>>
inpm :: INPM SRGB Float
[ [ 3.24060000,-1.53720000,-0.49860000 ] , [-0.96890000, 1.87580000, 0.04150000 ] , [ 0.05570000,-0.20400000, 1.05700000 ] ]
Instances
This is an approximation of CIE1931 D50
white point defined in ICC PCS. Useful for chromatic adaptation.
>>>
whitePoint :: WhitePoint D50 Double
WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D50:( 0.3457029149190000, 0.3585385966800000)>})>>>
whitePointTristimulus :: Color (XYZ D50) Float
<XYZ * D50:( 0.96420000, 1.00000000, 0.82490010)>>>>
colorTemperature :: CCT D50
CCT {unCCT = 5003.0}
Since: 0.1.0
Instances
Illuminant D50 Source # | Tristimulus |
Defined in Graphics.Color.Illuminant.ICC.PCS type Temperature D50 :: n Source # whitePoint :: RealFloat e => WhitePoint D50 e Source # | |
type Temperature D50 Source # | |
Defined in Graphics.Color.Illuminant.ICC.PCS |
Whitepoint D65 that is so commonly used for sRGB and other color spaces defined by
ITU: Rec.601 (525 and 625) and Rec.709 standards. It is slightly different than
D65
that is defined by CIE1931 and
D65
specified in Rec.470.
>>>
whitePoint :: WhitePoint D65 Float
WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})>>>
whitePointTristimulus :: Color (XYZ D65) Float
<XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>>>>
colorTemperature :: CCT D65
CCT {unCCT = 6504.0}
Since: 0.1.0