{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NegativeLiterals #-}
{-# LANGUAGE DataKinds #-}
module Graphics.Color.Illuminant.CIE1931
( CIE1931(..)
, wavelengths
, rectifyColorTemperature
) where
import Graphics.Color.Algebra
import Graphics.Color.Space.Internal
rectifyColorTemperature ::
Int
-> Double
-> CCT (i :: k)
rectifyColorTemperature cct c2 = CCT (fromIntegral cct * 1.4388 / c2)
instance Illuminant 'A where
type Temperature 'A = 2856
whitePoint = WhitePoint 0.44758 0.40745
colorTemperature = rectifyColorTemperature 2848 1.4350
instance Illuminant 'B where
type Temperature 'B = 4874
whitePoint = WhitePoint 0.34842 0.35161
instance Illuminant 'C where
type Temperature 'C = 6774
whitePoint = WhitePoint 0.31006 0.31616
instance Illuminant 'D50 where
type Temperature 'D50 = 5003
whitePoint = WhitePoint 0.34567 0.35851
colorTemperature = rectifyColorTemperature 5000 1.4380
instance Illuminant 'D55 where
type Temperature 'D55 = 5503
whitePoint = WhitePoint 0.33243 0.34744
colorTemperature = rectifyColorTemperature 5500 1.4380
instance Illuminant 'D60 where
type Temperature 'D60 = 6003
whitePoint = WhitePoint 0.32163 0.33774
colorTemperature = rectifyColorTemperature 6000 1.4380
instance Illuminant 'D65 where
type Temperature 'D65 = 6504
whitePoint = WhitePoint 0.31272 0.32903
colorTemperature = rectifyColorTemperature 6500 1.4380
instance Illuminant 'D75 where
type Temperature 'D75 = 7504
whitePoint = WhitePoint 0.29903 0.31488
colorTemperature = rectifyColorTemperature 7500 1.4380
instance Illuminant 'E where
type Temperature 'E = 5454
whitePoint = WhitePoint (1 / 3) (1 / 3)
instance Illuminant 'FL1 where
type Temperature 'FL1 = 6430
whitePoint = WhitePoint 0.31310 0.33710
instance Illuminant 'FL2 where
type Temperature 'FL2 = 4230
whitePoint = WhitePoint 0.37210 0.37510
instance Illuminant 'FL3 where
type Temperature 'FL3 = 3450
whitePoint = WhitePoint 0.40910 0.39410
instance Illuminant 'FL4 where
type Temperature 'FL4 = 2940
whitePoint = WhitePoint 0.44020 0.40310
instance Illuminant 'FL5 where
type Temperature 'FL5 = 6350
whitePoint = WhitePoint 0.31380 0.34520
instance Illuminant 'FL6 where
type Temperature 'FL6 = 4150
whitePoint = WhitePoint 0.37790 0.38820
instance Illuminant 'FL7 where
type Temperature 'FL7 = 6500
whitePoint = WhitePoint 0.31290 0.32920
instance Illuminant 'FL8 where
type Temperature 'FL8 = 5000
whitePoint = WhitePoint 0.34580 0.35860
instance Illuminant 'FL9 where
type Temperature 'FL9 = 4150
whitePoint = WhitePoint 0.37410 0.37270
instance Illuminant 'FL10 where
type Temperature 'FL10 = 5000
whitePoint = WhitePoint 0.34580 0.35880
instance Illuminant 'FL11 where
type Temperature 'FL11 = 4000
whitePoint = WhitePoint 0.38050 0.37690
instance Illuminant 'FL12 where
type Temperature 'FL12 = 3000
whitePoint = WhitePoint 0.43700 0.40420
instance Illuminant 'FL3_1 where
type Temperature 'FL3_1 = 2932
whitePoint = WhitePoint 0.44070 0.40330
instance Illuminant 'FL3_2 where
type Temperature 'FL3_2 = 3965
whitePoint = WhitePoint 0.38080 0.37340
instance Illuminant 'FL3_3 where
type Temperature 'FL3_3 = 6280
whitePoint = WhitePoint 0.31530 0.34390
instance Illuminant 'FL3_4 where
type Temperature 'FL3_4 = 2904
whitePoint = WhitePoint 0.44290 0.40430
instance Illuminant 'FL3_5 where
type Temperature 'FL3_5 = 4086
whitePoint = WhitePoint 0.37490 0.36720
instance Illuminant 'FL3_6 where
type Temperature 'FL3_6 = 4894
whitePoint = WhitePoint 0.34880 0.36000
instance Illuminant 'FL3_7 where
type Temperature 'FL3_7 = 2979
whitePoint = WhitePoint 0.43840 0.40450
instance Illuminant 'FL3_8 where
type Temperature 'FL3_8 = 4006
whitePoint = WhitePoint 0.38200 0.38320
instance Illuminant 'FL3_9 where
type Temperature 'FL3_9 = 4853
whitePoint = WhitePoint 0.34990 0.35910
instance Illuminant 'FL3_10 where
type Temperature 'FL3_10 = 5000
whitePoint = WhitePoint 0.34550 0.35600
instance Illuminant 'FL3_11 where
type Temperature 'FL3_11 = 5854
whitePoint = WhitePoint 0.32450 0.34340
instance Illuminant 'FL3_12 where
type Temperature 'FL3_12 = 2984
whitePoint = WhitePoint 0.43770 0.40370
instance Illuminant 'FL3_13 where
type Temperature 'FL3_13 = 3896
whitePoint = WhitePoint 0.38300 0.37240
instance Illuminant 'FL3_14 where
type Temperature 'FL3_14 = 5045
whitePoint = WhitePoint 0.34470 0.36090
instance Illuminant 'FL3_15 where
type Temperature 'FL3_15 = 6509
whitePoint = WhitePoint 0.31270 0.32880
instance Illuminant 'HP1 where
type Temperature 'HP1 = 1959
whitePoint = WhitePoint 0.53300 0.41500
instance Illuminant 'HP2 where
type Temperature 'HP2 = 2506
whitePoint = WhitePoint 0.47780 0.41580
instance Illuminant 'HP3 where
type Temperature 'HP3 = 3144
whitePoint = WhitePoint 0.43020 0.40750
instance Illuminant 'HP4 where
type Temperature 'HP4 = 4002
whitePoint = WhitePoint 0.38120 0.37970
instance Illuminant 'HP5 where
type Temperature 'HP5 = 4039
whitePoint = WhitePoint 0.37760 0.37130
data CIE1931
= A
| B
| C
| D50
| D55
| D60
| D65
| D75
| E
| FL1
| FL2
| FL3
| FL4
| FL5
| FL6
| FL7
| FL8
| FL9
| FL10
| FL11
| FL12
| FL3_1
| FL3_2
| FL3_3
| FL3_4
| FL3_5
| FL3_6
| FL3_7
| FL3_8
| FL3_9
| FL3_10
| FL3_11
| FL3_12
| FL3_13
| FL3_14
| FL3_15
| HP1
| HP2
| HP3
| HP4
| HP5
deriving (Eq, Show, Read, Enum, Bounded)
wavelengths :: [(Double, V3 Double)]
wavelengths =
[ (300, V3 0.04 0.02 0.00)
, (305, V3 3.02 2.26 1.00)
, (310, V3 6.00 4.50 2.00)
, (315, V3 17.80 13.45 3.00)
, (320, V3 29.60 22.40 4.00)
, (325, V3 42.45 32.20 6.25)
, (330, V3 55.30 42.00 8.50)
, (335, V3 56.30 41.30 8.15)
, (340, V3 57.30 40.60 7.80)
, (345, V3 59.55 41.10 7.25)
, (350, V3 61.80 41.60 6.70)
, (355, V3 61.65 39.80 6.00)
, (360, V3 61.50 38.00 5.30)
, (365, V3 65.15 40.20 5.70)
, (370, V3 68.80 42.40 6.10)
, (375, V3 66.10 40.45 4.55)
, (380, V3 63.40 38.50 3.00)
, (385, V3 64.60 36.75 2.10)
, (390, V3 65.80 35.00 1.20)
, (395, V3 80.30 39.20 0.05)
, (400, V3 94.80 43.40 -1.10)
, (405, V3 99.80 44.85 -0.80)
, (410, V3 104.80 46.30 -0.50)
, (415, V3 105.35 45.10 -0.60)
, (420, V3 105.90 43.90 -0.70)
, (425, V3 101.35 40.50 -0.95)
, (430, V3 96.80 37.10 -1.20)
, (435, V3 105.35 36.90 -1.90)
, (440, V3 113.90 36.70 -2.60)
, (445, V3 119.75 36.30 -2.75)
, (450, V3 125.60 35.90 -2.90)
, (455, V3 125.55 34.25 -2.85)
, (460, V3 125.50 32.60 -2.80)
, (465, V3 123.40 30.25 -2.70)
, (470, V3 121.30 27.90 -2.60)
, (475, V3 121.30 26.10 -2.60)
, (480, V3 121.30 24.30 -2.60)
, (485, V3 117.40 22.20 -2.20)
, (490, V3 113.50 20.10 -1.80)
, (495, V3 113.30 18.15 -1.65)
, (500, V3 113.10 16.20 -1.50)
, (505, V3 111.95 14.70 -1.40)
, (510, V3 110.80 13.20 -1.30)
, (515, V3 108.65 10.90 -1.25)
, (520, V3 106.50 8.60 -1.20)
, (525, V3 107.65 7.35 -1.10)
, (530, V3 108.80 6.10 -1.00)
, (535, V3 107.05 5.15 -0.75)
, (540, V3 105.30 4.20 -0.50)
, (545, V3 104.85 3.05 -0.40)
, (550, V3 104.40 1.90 -0.30)
, (555, V3 102.20 0.95 -0.15)
, (560, V3 100.00 0.00 0.00)
, (565, V3 98.00 -0.80 0.10)
, (570, V3 96.00 -1.60 0.20)
, (575, V3 95.55 -2.55 0.35)
, (580, V3 95.10 -3.50 0.50)
, (585, V3 92.10 -3.50 1.30)
, (590, V3 89.10 -3.50 2.10)
, (595, V3 89.80 -4.65 2.65)
, (600, V3 90.50 -5.80 3.20)
, (605, V3 90.40 -6.50 3.65)
, (610, V3 90.30 -7.20 4.10)
, (615, V3 89.35 -7.90 4.40)
, (620, V3 88.40 -8.60 4.70)
, (625, V3 86.20 -9.05 4.90)
, (630, V3 84.00 -9.50 5.10)
, (635, V3 84.55 -10.20 5.90)
, (640, V3 85.10 -10.90 6.70)
, (645, V3 83.50 -10.80 7.00)
, (650, V3 81.90 -10.70 7.30)
, (655, V3 82.25 -11.35 7.95)
, (660, V3 82.60 -12.00 8.60)
, (665, V3 83.75 -13.00 9.20)
, (670, V3 84.90 -14.00 9.80)
, (675, V3 83.10 -13.80 10.00)
, (680, V3 81.30 -13.60 10.20)
, (685, V3 76.60 -12.80 9.25)
, (690, V3 71.90 -12.00 8.30)
, (695, V3 73.10 -12.65 8.95)
, (700, V3 74.30 -13.30 9.60)
, (705, V3 75.35 -13.10 9.05)
, (710, V3 76.40 -12.90 8.50)
, (715, V3 69.85 -11.75 7.75)
, (720, V3 63.30 -10.60 7.00)
, (725, V3 67.50 -11.10 7.30)
, (730, V3 71.70 -11.60 7.60)
, (735, V3 74.35 -11.90 7.80)
, (740, V3 77.00 -12.20 8.00)
, (745, V3 71.10 -11.20 7.35)
, (750, V3 65.20 -10.20 6.70)
, (755, V3 56.45 -9.00 5.95)
, (760, V3 47.70 -7.80 5.20)
, (765, V3 58.15 -9.50 6.30)
, (770, V3 68.60 -11.20 7.40)
, (775, V3 66.80 -10.80 7.10)
, (780, V3 65.00 -10.40 6.80)
, (785, V3 65.50 -10.50 6.90)
, (790, V3 66.00 -10.60 7.00)
, (795, V3 63.50 -10.15 6.70)
, (800, V3 61.00 -9.70 6.40)
, (805, V3 57.15 -9.00 5.95)
, (810, V3 53.30 -8.30 5.50)
, (815, V3 56.10 -8.80 5.80)
, (820, V3 58.90 -9.30 6.10)
, (825, V3 60.40 -9.55 6.30)
, (830, V3 61.90 -9.80 6.50)
]