色温CCT与色坐标xy互换
色温与色坐标相互转换,覆盖1666k~25000k,精度非常高。也包括冷暖双色PWM调光公式。
·
在照明系统设计中,要想做到色温可调,色温、色品图转换是越不过的坎。
然而网上的一些工具以及计算公式各不相同,应用范围有限。本人通过查找相关论文,以及实际应用测试,总结了相关公式。
- 附件中支持色坐标到色温的转换,涉及到两套公式,第一套公式的精度较高,误差在3K左右。
- 也支持色温到色坐标的转换,绿表格中输入对应的值,黄色表格就会出相应的值。
xm | 0.3000 | ym | 0.4061 | CCT | 4000 | |
公式一计算CCT值 | 6651 | Ym | 600.0 | |||
公式二计算CCT值 | 6587 | CCT换算x坐标 | 0.3805 | |||
CCT换算y坐标 | 0.3767 |
- 采用相关公式算出的坐标曲线与色品图中的色温曲线完全重合,支持1666k~25000k。
- 已知冷暖灯珠的xyY(色坐标值),采用pwm调光,就可以算出对应的PWM占空比大小。
x | y | Y | CCT | 占空比 | |
冷灯珠参数 | 0.3196 | 0.3375 | 500 | 6500 | 0.633 |
暖灯珠参数 | 0.4638 | 0.4141 | 500 | 2700 | 0.462 |
- 以及色温对应RGB值表(下表截取一部分),也会显示对应色温的颜色,清晰明了。色温步进为10k,非常精细。步进可自行添加。
2380 | 0.4876 | 0.4148 | 54.18314717 | 46.1 | 255 | 159 | 64 |
2390 | 0.4866 | 0.4148 | 54.32117772 | 46.3 | 255 | 159 | 65 |
2400 | 0.4857 | 0.4147 | 54.4594467 | 46.5 | 255 | 160 | 66 |
2410 | 0.4847 | 0.4146 | 54.59795505 | 46.7 | 255 | 160 | 66 |
2420 | 0.4838 | 0.4145 | 54.73670361 | 46.9 | 255 | 161 | 67 |
2430 | 0.4829 | 0.4144 | 54.87569314 | 47.1 | 255 | 161 | 68 |
2440 | 0.4819 | 0.4144 | 55.01492426 | 47.3 | 255 | 162 | 69 |
2450 | 0.4810 | 0.4143 | 55.15439752 | 47.5 | 255 | 162 | 70 |
2460 | 0.4801 | 0.4142 | 55.29411337 | 47.7 | 255 | 163 | 71 |
2470 | 0.4792 | 0.4141 | 55.43407218 | 47.9 | 255 | 163 | 71 |
2480 | 0.4783 | 0.4139 | 55.57427423 | 48.1 | 255 | 164 | 72 |
2490 | 0.4774 | 0.4138 | 55.71471973 | 48.3 | 255 | 164 | 73 |
2500 | 0.4765 | 0.4137 | 55.85540882 | 48.5 | 255 | 165 | 74 |
2510 | 0.4756 | 0.4136 | 55.99634155 | 48.7 | 255 | 165 | 75 |
2520 | 0.4747 | 0.4135 | 56.13751792 | 48.9 | 255 | 165 | 75 |
2530 | 0.4738 | 0.4133 | 56.27893787 | 49.1 | 255 | 166 | 76 |
2540 | 0.4729 | 0.4132 | 56.42060126 | 49.3 | 255 | 166 | 77 |
2550 | 0.4720 | 0.4131 | 56.56250792 | 49.5 | 255 | 167 | 78 |
2560 | 0.4711 | 0.4129 | 56.70465761 | 49.7 | 255 | 167 | 79 |
2570 | 0.4703 | 0.4128 | 56.84705003 | 49.9 | 255 | 168 | 79 |
2580 | 0.4694 | 0.4127 | 56.98968484 | 50.1 | 255 | 168 | 80 |
2590 | 0.4685 | 0.4125 | 57.13256168 | 50.3 | 255 | 168 | 81 |
2600 | 0.4677 | 0.4123 | 57.27568009 | 50.5 | 255 | 169 | 82 |
2610 | 0.4668 | 0.4122 | 57.41903963 | 50.7 | 255 | 169 | 82 |
2620 | 0.4660 | 0.4120 | 57.56263978 | 50.9 | 255 | 170 | 83 |
2630 | 0.4651 | 0.4119 | 57.70647999 | 51.1 | 255 | 170 | 84 |
2640 | 0.4643 | 0.4117 | 57.85055969 | 51.3 | 255 | 170 | 85 |
2650 | 0.4634 | 0.4115 | 57.99487826 | 51.5 | 255 | 171 | 85 |
2660 | 0.4626 | 0.4114 | 58.13943508 | 51.7 | 255 | 171 | 86 |
2670 | 0.4618 | 0.4112 | 58.28422945 | 51.9 | 255 | 172 | 87 |
2680 | 0.4610 | 0.4110 | 58.31711239 | 52.0 | 255 | 172 | 88 |
2690 | 0.4601 | 0.4108 | 58.35053368 | 52.1 | 255 | 173 | 88 |
2700 | 0.4593 | 0.4107 | 58.38448778 | 52.2 | 255 | 173 | 89 |
2710 | 0.4585 | 0.4105 | 58.41896919 | 52.3 | 255 | 173 | 90 |
2720 | 0.4577 | 0.4103 | 58.45397248 | 52.4 | 255 | 174 | 91 |
2730 | 0.4569 | 0.4101 | 58.48949226 | 52.5 | 255 | 174 | 91 |
2740 | 0.4561 | 0.4099 | 58.52552322 | 52.6 | 255 | 174 | 92 |
2750 | 0.4553 | 0.4097 | 58.56206008 | 52.7 | 255 | 175 | 93 |
2760 | 0.4545 | 0.4095 | 58.59909763 | 52.8 | 255 | 175 | 93 |
2770 | 0.4537 | 0.4093 | 58.63663072 | 52.9 | 255 | 176 | 94 |
2780 | 0.4529 | 0.4091 | 58.67465425 | 53.0 | 255 | 176 | 95 |
2790 | 0.4521 | 0.4089 | 58.71316316 | 53.1 | 255 | 176 | 95 |
2800 | 0.4514 | 0.4087 | 58.75215249 | 53.2 | 255 | 177 | 96 |
2810 | 0.4506 | 0.4085 | 58.79161728 | 53.3 | 255 | 177 | 97 |
2820 | 0.4498 | 0.4083 | 58.83155266 | 53.4 | 255 | 177 | 97 |
2830 | 0.4490 | 0.4081 | 58.87195381 | 53.5 | 255 | 178 | 98 |
2840 | 0.4483 | 0.4079 | 58.91281595 | 53.6 | 255 | 178 | 99 |
2850 | 0.4475 | 0.4076 | 58.95413438 | 53.7 | 255 | 179 | 100 |
2860 | 0.4468 | 0.4074 | 58.99590443 | 53.8 | 255 | 179 | 100 |
2870 | 0.4460 | 0.4072 | 59.14765419 | 54.0 | 255 | 179 | 101 |
2880 | 0.4453 | 0.4070 | 59.29959872 | 54.2 | 255 | 180 | 102 |
2890 | 0.4445 | 0.4068 | 59.45173733 | 54.4 | 255 | 180 | 102 |
2900 | 0.4438 | 0.4065 | 59.60406931 | 54.6 | 255 | 180 | 103 |
2910 | 0.4430 | 0.4063 | 59.75659394 | 54.8 | 255 | 181 | 104 |
2920 | 0.4423 | 0.4061 | 59.90931049 | 55.0 | 255 | 181 | 104 |
2930 | 0.4416 | 0.4058 | 60.06221825 | 55.2 | 255 | 181 | 105 |
2940 | 0.4409 | 0.4056 | 60.21531645 | 55.4 | 255 | 182 | 106 |
2950 | 0.4401 | 0.4054 | 60.36860438 | 55.6 | 255 | 182 | 106 |
2960 | 0.4394 | 0.4051 | 60.52208126 | 55.8 | 255 | 183 | 107 |
2970 | 0.4387 | 0.4049 | 60.67574636 | 56.0 | 255 | 183 | 108 |
2980 | 0.4380 | 0.4047 | 60.8295989 | 56.2 | 255 | 183 | 108 |
2990 | 0.4373 | 0.4044 | 60.98363814 | 56.4 | 255 | 184 | 109 |
3000 | 0.4366 | 0.4042 | 61.1378633 | 56.6 | 255 | 184 | 109 |
3010 | 0.4359 | 0.4039 | 61.29227361 | 56.8 | 255 | 184 | 110 |
3020 | 0.4352 | 0.4037 | 61.44686831 | 57.0 | 255 | 185 | 111 |
3030 | 0.4345 | 0.4034 | 61.60164661 | 57.2 | 255 | 185 | 111 |
3040 | 0.4338 | 0.4032 | 61.75660775 | 57.4 | 255 | 185 | 112 |
3050 | 0.4331 | 0.4029 | 61.91175094 | 57.6 | 255 | 186 | 113 |
3060 | 0.4324 | 0.4027 | 62.0670754 | 57.8 | 255 | 186 | 113 |
3070 | 0.4317 | 0.4024 | 62.22258036 | 58.0 | 255 | 186 | 114 |
3080 | 0.4311 | 0.4022 | 62.37826503 | 58.2 | 255 | 187 | 115 |
3090 | 0.4304 | 0.4019 | 62.53412863 | 58.4 | 255 | 187 | 115 |
3100 | 0.4297 | 0.4017 | 62.69017038 | 58.6 | 255 | 187 | 116 |
3110 | 0.4290 | 0.4014 | 62.8463895 | 58.8 | 255 | 188 | 116 |
3120 | 0.4284 | 0.4012 | 63.00278519 | 59.0 | 255 | 188 | 117 |
3130 | 0.4277 | 0.4009 | 63.15935669 | 59.2 | 255 | 188 | 118 |
3140 | 0.4271 | 0.4007 | 63.31610321 | 59.4 | 255 | 188 | 118 |
3150 | 0.4264 | 0.4004 | 63.3665256 | 59.5 | 255 | 189 | 119 |
3160 | 0.4258 | 0.4001 | 63.41730842 | 59.6 | 255 | 189 | 120 |
3170 | 0.4251 | 0.3999 | 63.46844816 | 59.7 | 255 | 189 | 120 |
3180 | 0.4245 | 0.3996 | 63.51994133 | 59.8 | 255 | 190 | 121 |
3190 | 0.4238 | 0.3993 | 63.57178453 | 59.9 | 255 | 190 | 121 |
3200 | 0.4232 | 0.3991 | 63.62397435 | 60.0 | 255 | 190 | 122 |
3210 | 0.4225 | 0.3988 | 63.67650747 | 60.1 | 255 | 191 | 123 |
3220 | 0.4219 | 0.3985 | 63.72938057 | 60.2 | 255 | 191 | 123 |
3230 | 0.4213 | 0.3983 | 63.7825904 | 60.3 | 255 | 191 | 124 |
3240 | 0.4207 | 0.3980 | 63.83613373 | 60.4 | 255 | 192 | 124 |
3250 | 0.4200 | 0.3977 | 63.89000738 | 60.5 | 255 | 192 | 125 |
3260 | 0.4194 | 0.3975 | 63.94420821 | 60.6 | 255 | 192 | 125 |
3270 | 0.4188 | 0.3972 | 63.99873309 | 60.7 | 255 | 192 | 126 |
3280 | 0.4182 | 0.3969 | 64.05357898 | 60.8 | 255 | 193 | 127 |
3290 | 0.4176 | 0.3967 | 64.10874283 | 60.9 | 255 | 193 | 127 |
3300 | 0.4170 | 0.3964 | 64.16422165 | 61.0 | 255 | 193 | 128 |
3310 | 0.4163 | 0.3961 | 64.22001248 | 61.1 | 255 | 194 | 128 |
3320 | 0.4157 | 0.3958 | 64.2761124 | 61.2 | 255 | 194 | 129 |
3330 | 0.4151 | 0.3956 | 64.33251852 | 61.3 | 255 | 194 | 130 |
3340 | 0.4145 | 0.3953 | 64.38922798 | 61.4 | 255 | 194 | 130 |
3350 | 0.4139 | 0.3950 | 64.44623797 | 61.5 | 255 | 195 | 131 |
3360 | 0.4134 | 0.3947 | 64.5035457 | 61.6 | 255 | 195 | 131 |
3370 | 0.4128 | 0.3945 | 64.56114842 | 61.7 | 255 | 195 | 132 |
3380 | 0.4122 | 0.3942 | 64.61904342 | 61.8 | 255 | 196 | 132 |
3390 | 0.4116 | 0.3939 | 64.67722799 | 61.9 | 255 | 196 | 133 |
3400 | 0.4110 | 0.3936 | 64.7356995 | 62.0 | 255 | 196 | 134 |
3410 | 0.4104 | 0.3934 | 64.79445532 | 62.1 | 255 | 196 | 134 |
3420 | 0.4099 | 0.3931 | 64.85349286 | 62.2 | 255 | 197 | 135 |
3430 | 0.4093 | 0.3928 | 64.91280955 | 62.3 | 255 | 197 | 135 |
3440 | 0.4087 | 0.3925 | 64.97240288 | 62.4 | 255 | 197 | 136 |
3450 | 0.4081 | 0.3923 | 65.13632196 | 62.6 | 255 | 198 | 136 |
3460 | 0.4076 | 0.3920 | 65.30037241 | 62.8 | 255 | 198 | 137 |
3470 | 0.4070 | 0.3917 | 65.46455373 | 63.0 | 255 | 198 | 138 |
3480 | 0.4065 | 0.3914 | 65.62886546 | 63.2 | 255 | 198 | 138 |
3490 | 0.4059 | 0.3911 | 65.79330711 | 63.4 | 255 | 199 | 139 |
3500 | 0.4053 | 0.3909 | 65.95787821 | 63.6 | 255 | 199 | 139 |
3510 | 0.4048 | 0.3906 | 66.12257827 | 63.8 | 255 | 199 | 140 |
3520 | 0.4042 | 0.3903 | 66.28740682 | 64.0 | 255 | 199 | 140 |
3530 | 0.4037 | 0.3900 | 66.45236339 | 64.2 | 255 | 200 | 141 |
3540 | 0.4031 | 0.3897 | 66.61744751 | 64.4 | 255 | 200 | 141 |
3550 | 0.4026 | 0.3894 | 66.78265869 | 64.6 | 255 | 200 | 142 |
3560 | 0.4021 | 0.3892 | 66.94799647 | 64.8 | 255 | 201 | 142 |
3570 | 0.4015 | 0.3889 | 67.11346039 | 65.0 | 255 | 201 | 143 |
3580 | 0.4010 | 0.3886 | 67.27904997 | 65.2 | 255 | 201 | 144 |
3590 | 0.4005 | 0.3883 | 67.44476476 | 65.4 | 255 | 201 | 144 |
3600 | 0.3999 | 0.3880 | 67.61060427 | 65.6 | 255 | 202 | 145 |
3610 | 0.3994 | 0.3878 | 67.77656806 | 65.8 | 255 | 202 | 145 |
3620 | 0.3989 | 0.3875 | 67.94265566 | 66.0 | 255 | 202 | 146 |
3630 | 0.3984 | 0.3872 | 68.10886661 | 66.2 | 255 | 202 | 146 |
3640 | 0.3978 | 0.3869 | 68.27520045 | 66.4 | 255 | 203 | 147 |
3650 | 0.3973 | 0.3866 | 68.44165673 | 66.6 | 255 | 203 | 147 |
3660 | 0.3968 | 0.3863 | 68.608235 | 66.8 | 255 | 203 | 148 |
3670 | 0.3963 | 0.3861 | 68.7749348 | 67.0 | 255 | 203 | 148 |
3680 | 0.3958 | 0.3858 | 68.94175567 | 67.2 | 255 | 204 | 149 |
3690 | 0.3953 | 0.3855 | 69.00616202 | 67.3 | 255 | 204 | 149 |
3700 | 0.3948 | 0.3852 | 69.07080101 | 67.4 | 255 | 204 | 150 |
3710 | 0.3942 | 0.3849 | 69.13567066 | 67.5 | 255 | 204 | 151 |
3720 | 0.3937 | 0.3846 | 69.20076903 | 67.6 | 255 | 205 | 151 |
3730 | 0.3932 | 0.3844 | 69.2660942 | 67.7 | 255 | 205 | 152 |
3740 | 0.3927 | 0.3841 | 69.33164425 | 67.8 | 255 | 205 | 152 |
3750 | 0.3923 | 0.3838 | 69.3974173 | 67.9 | 255 | 205 | 153 |
3760 | 0.3918 | 0.3835 | 69.46341151 | 68.0 | 255 | 206 | 153 |
3770 | 0.3913 | 0.3832 | 69.52962501 | 68.1 | 255 | 206 | 154 |
3780 | 0.3908 | 0.3829 | 69.59605601 | 68.2 | 255 | 206 | 154 |
3790 | 0.3903 | 0.3827 | 69.66270269 | 68.3 | 255 | 206 | 155 |
3800 | 0.3898 | 0.3824 | 69.72956327 | 68.4 | 255 | 207 | 155 |
3810 | 0.3893 | 0.3821 | 69.79663601 | 68.5 | 255 | 207 | 156 |
3820 | 0.3888 | 0.3818 | 69.86391915 | 68.6 | 255 | 207 | 156 |
3830 | 0.3884 | 0.3815 | 69.93141098 | 68.7 | 255 | 207 | 157 |
3840 | 0.3879 | 0.3812 | 69.9991098 | 68.8 | 255 | 208 | 157 |
3850 | 0.3874 | 0.3810 | 70.06701393 | 68.9 | 255 | 208 | 158 |
3860 | 0.3869 | 0.3807 | 70.1351217 | 69.0 | 255 | 208 | 158 |
3870 | 0.3865 | 0.3804 | 70.20343146 | 69.1 | 255 | 208 | 159 |
3880 | 0.3860 | 0.3801 | 70.27194159 | 69.2 | 255 | 208 | 159 |
3890 | 0.3855 | 0.3798 | 70.34065048 | 69.3 | 255 | 209 | 160 |
3900 | 0.3851 | 0.3795 | 70.40955654 | 69.4 | 255 | 209 | 160 |
3910 | 0.3846 | 0.3793 | 70.4786582 | 69.5 | 255 | 209 | 161 |
3920 | 0.3841 | 0.3790 | 70.54795389 | 69.6 | 255 | 209 | 161 |
3930 | 0.3837 | 0.3787 | 70.61744207 | 69.7 | 255 | 210 | 162 |
3940 | 0.3832 | 0.3784 | 70.68712123 | 69.8 | 255 | 210 | 162 |
3950 | 0.3828 | 0.3781 | 70.75698985 | 69.9 | 255 | 210 | 163 |
3960 | 0.3823 | 0.3779 | 70.82704645 | 70.0 | 255 | 210 | 163 |
3970 | 0.3819 | 0.3776 | 70.89728955 | 70.1 | 255 | 211 | 164 |
3980 | 0.3814 | 0.3773 | 70.96771767 | 70.2 | 255 | 211 | 164 |
3990 | 0.3810 | 0.3770 | 71.13937966 | 70.4 | 255 | 211 | 165 |
4000 | 0.3805 | 0.3767 | 71.30647385 | 70.6 | 255 | 211 | 165 |
4010 | 0.3800 | 0.3764 | 71.47843975 | 70.8 | 255 | 211 | 166 |
4020 | 0.3796 | 0.3761 | 71.64957602 | 71.0 | 255 | 212 | 166 |
4030 | 0.3791 | 0.3759 | 71.82081284 | 71.2 | 255 | 212 | 167 |
4040 | 0.3787 | 0.3756 | 71.99215034 | 71.4 | 255 | 212 | 167 |
4050 | 0.3783 | 0.3753 | 72.16358861 | 71.6 | 255 | 212 | 168 |
4060 | 0.3778 | 0.3750 | 72.33512777 | 71.8 | 255 | 213 | 168 |
4070 | 0.3774 | 0.3748 | 72.5067679 | 72.0 | 255 | 213 | 169 |
4080 | 0.3770 | 0.3745 | 72.67850909 | 72.2 | 255 | 213 | 169 |
4090 | 0.3766 | 0.3742 | 72.8503514 | 72.4 | 255 | 213 | 170 |
4100 | 0.3761 | 0.3740 | 73.0222949 | 72.6 | 255 | 213 | 170 |
4110 | 0.3757 | 0.3737 | 73.19433964 | 72.8 | 255 | 214 | 170 |
4120 | 0.3753 | 0.3734 | 73.36648566 | 73.0 | 255 | 214 | 171 |
4130 | 0.3749 | 0.3731 | 73.538733 | 73.2 | 255 | 214 | 171 |
4140 | 0.3745 | 0.3729 | 73.61065785 | 73.3 | 255 | 214 | 172 |
4150 | 0.3740 | 0.3726 | 73.68276123 | 73.4 | 255 | 215 | 172 |
4160 | 0.3736 | 0.3723 | 73.75504211 | 73.5 | 255 | 215 | 173 |
4170 | 0.3732 | 0.3721 | 73.92780854 | 73.7 | 255 | 215 | 173 |
4180 | 0.3728 | 0.3718 | 74.00040377 | 73.8 | 255 | 215 | 174 |
4190 | 0.3724 | 0.3715 | 74.07317374 | 73.9 | 255 | 215 | 174 |
4200 | 0.3720 | 0.3713 | 74.14611746 | 74.0 | 255 | 216 | 175 |
4210 | 0.3716 | 0.3710 | 74.21923388 | 74.1 | 255 | 216 | 175 |
4220 | 0.3712 | 0.3707 | 74.29252202 | 74.2 | 255 | 216 | 176 |
4230 | 0.3708 | 0.3705 | 74.36598084 | 74.3 | 255 | 216 | 176 |
4240 | 0.3704 | 0.3702 | 74.43960935 | 74.4 | 255 | 216 | 177 |
4250 | 0.3700 | 0.3699 | 74.51340654 | 74.5 | 255 | 217 | 177 |
4260 | 0.3696 | 0.3697 | 74.58737142 | 74.6 | 255 | 217 | 177 |
4270 | 0.3692 | 0.3694 | 74.66150298 | 74.7 | 255 | 217 | 178 |
4280 | 0.3688 | 0.3692 | 74.73580025 | 74.8 | 255 | 217 | 178 |
4290 | 0.3684 | 0.3689 | 74.81026222 | 74.9 | 255 | 217 | 179 |
4300 | 0.3681 | 0.3686 | 74.88488793 | 75.0 | 255 | 218 | 179 |
4310 | 0.3677 | 0.3684 | 74.95967638 | 75.1 | 255 | 218 | 180 |
4320 | 0.3673 | 0.3681 | 75.03462661 | 75.2 | 255 | 218 | 180 |
4330 | 0.3669 | 0.3678 | 75.10973764 | 75.3 | 255 | 218 | 181 |
4340 | 0.3665 | 0.3676 | 75.18500851 | 75.4 | 255 | 218 | 181 |
4350 | 0.3662 | 0.3673 | 75.26043826 | 75.5 | 255 | 219 | 181 |
4360 | 0.3658 | 0.3671 | 75.33602593 | 75.6 | 255 | 219 | 182 |
4370 | 0.3654 | 0.3668 | 75.41177057 | 75.7 | 255 | 219 | 182 |
4380 | 0.3650 | 0.3666 | 75.48767123 | 75.8 | 255 | 219 | 183 |
4390 | 0.3647 | 0.3663 | 75.56372696 | 75.9 | 255 | 219 | 183 |
4400 | 0.3643 | 0.3660 | 75.63993683 | 76.0 | 255 | 220 | 184 |
4410 | 0.3639 | 0.3658 | 75.7162999 | 76.1 | 255 | 220 | 184 |
4420 | 0.3636 | 0.3655 | 75.79281524 | 76.2 | 255 | 220 | 184 |
资料整理不易,多谢支持。
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献2条内容
所有评论(0)