-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColorConversion.h
128 lines (123 loc) · 6.35 KB
/
ColorConversion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//
// Created by Kamil Rojewski on 16.07.2021.
//
#ifndef OPENRGB_AMBIENT_COLORCONVERSION_H
#define OPENRGB_AMBIENT_COLORCONVERSION_H
#include <array>
// HUE 2 LEDs are cool white, so simply scale down blue a bit
const auto coolWhiteBlueScale = 0.6f;
// 100K jump, starting at 1000K
const std::array<float, 3> colorTemperatureFactors[] = {
{ 1.0, 0.2196078431372549, 0.0 },
{ 1.0, 0.2784313725490196, 0.0 },
{ 1.0, 0.3254901960784314, 0.0 },
{ 1.0, 0.36470588235294116, 0.0 },
{ 1.0, 0.396078431372549, 0.0 },
{ 1.0, 0.42745098039215684, 0.0 },
{ 1.0, 0.45098039215686275, 0.0 },
{ 1.0, 0.4745098039215686, 0.0 },
{ 1.0, 0.49411764705882355, 0.0 },
{ 1.0, 0.5137254901960784, 0.0 },
{ 1.0, 0.5411764705882353, 0.07058823529411765 },
{ 1.0, 0.5568627450980392, 0.12941176470588237 },
{ 1.0, 0.5764705882352941, 0.17254901960784313 },
{ 1.0, 0.596078431372549, 0.21176470588235294 },
{ 1.0, 0.615686274509804, 0.24705882352941178 },
{ 1.0, 0.6313725490196078, 0.2823529411764706 },
{ 1.0, 0.6470588235294118, 0.30980392156862746 },
{ 1.0, 0.6627450980392157, 0.3411764705882353 },
{ 1.0, 0.6784313725490196, 0.3686274509803922 },
{ 1.0, 0.6941176470588235, 0.396078431372549 },
{ 1.0, 0.7058823529411765, 0.4196078431372549 },
{ 1.0, 0.7215686274509804, 0.4470588235294118 },
{ 1.0, 0.7333333333333333, 0.47058823529411764 },
{ 1.0, 0.7450980392156863, 0.49411764705882355 },
{ 1.0, 0.7568627450980392, 0.5176470588235295 },
{ 1.0, 0.7686274509803922, 0.5372549019607843 },
{ 1.0, 0.7803921568627451, 0.5607843137254902 },
{ 1.0, 0.788235294117647, 0.5803921568627451 },
{ 1.0, 0.8, 0.6 },
{ 1.0, 0.807843137254902, 0.6235294117647059 },
{ 1.0, 0.8196078431372549, 0.6392156862745098 },
{ 1.0, 0.8274509803921568, 0.6588235294117647 },
{ 1.0, 0.8352941176470589, 0.6784313725490196 },
{ 1.0, 0.8431372549019608, 0.6941176470588235 },
{ 1.0, 0.8509803921568627, 0.7137254901960784 },
{ 1.0, 0.8588235294117647, 0.7294117647058823 },
{ 1.0, 0.8666666666666667, 0.7450980392156863 },
{ 1.0, 0.8745098039215686, 0.7607843137254902 },
{ 1.0, 0.8823529411764706, 0.7764705882352941 },
{ 1.0, 0.8901960784313725, 0.792156862745098 },
{ 1.0, 0.8941176470588236, 0.807843137254902 },
{ 1.0, 0.9019607843137255, 0.8235294117647058 },
{ 1.0, 0.9098039215686274, 0.8352941176470589 },
{ 1.0, 0.9137254901960784, 0.8509803921568627 },
{ 1.0, 0.9215686274509803, 0.8627450980392157 },
{ 1.0, 0.9254901960784314, 0.8784313725490196 },
{ 1.0, 0.9333333333333333, 0.8901960784313725 },
{ 1.0, 0.9372549019607843, 0.9019607843137255 },
{ 1.0, 0.9411764705882353, 0.9137254901960784 },
{ 1.0, 0.9490196078431372, 0.9254901960784314 },
{ 1.0, 0.9529411764705882, 0.9372549019607843 },
{ 1.0, 0.9568627450980393, 0.9490196078431372 },
{ 1.0, 0.9607843137254902, 0.9607843137254902 },
{ 1.0, 0.9647058823529412, 0.9686274509803922 },
{ 1.0, 0.9725490196078431, 0.984313725490196 },
{ 1.0, 0.9764705882352941, 0.9921568627450981 },
{ 0.996078431372549, 0.9764705882352941, 1.0 },
{ 0.9882352941176471, 0.9686274509803922, 1.0 },
{ 0.9764705882352941, 0.9647058823529412, 1.0 },
{ 0.9686274509803922, 0.9607843137254902, 1.0 },
{ 0.9607843137254902, 0.9529411764705882, 1.0 },
{ 0.9529411764705882, 0.9490196078431372, 1.0 },
{ 0.9411764705882353, 0.9450980392156862, 1.0 },
{ 0.9372549019607843, 0.9411764705882353, 1.0 },
{ 0.9294117647058824, 0.9372549019607843, 1.0 },
{ 0.9215686274509803, 0.9333333333333333, 1.0 },
{ 0.9137254901960784, 0.9294117647058824, 1.0 },
{ 0.9058823529411765, 0.9254901960784314, 1.0 },
{ 0.9019607843137255, 0.9215686274509803, 1.0 },
{ 0.8941176470588236, 0.9176470588235294, 1.0 },
{ 0.8901960784313725, 0.9137254901960784, 1.0 },
{ 0.8823529411764706, 0.9098039215686274, 1.0 },
{ 0.8784313725490196, 0.9058823529411765, 1.0 },
{ 0.8705882352941177, 0.9019607843137255, 1.0 },
{ 0.8666666666666667, 0.9019607843137255, 1.0 },
{ 0.8627450980392157, 0.8980392156862745, 1.0 },
{ 0.8549019607843137, 0.8980392156862745, 1.0 },
{ 0.8509803921568627, 0.8901960784313725, 1.0 },
{ 0.8470588235294118, 0.8901960784313725, 1.0 },
{ 0.8431372549019608, 0.8862745098039215, 1.0 },
{ 0.8392156862745098, 0.8823529411764706, 1.0 },
{ 0.8313725490196079, 0.8823529411764706, 1.0 },
{ 0.8274509803921568, 0.8784313725490196, 1.0 },
{ 0.8235294117647058, 0.8745098039215686, 1.0 },
{ 0.8196078431372549, 0.8745098039215686, 1.0 },
{ 0.8156862745098039, 0.8705882352941177, 1.0 },
{ 0.8117647058823529, 0.8666666666666667, 1.0 },
{ 0.8117647058823529, 0.8666666666666667, 1.0 },
{ 0.807843137254902, 0.8627450980392157, 1.0 },
{ 0.803921568627451, 0.8627450980392157, 1.0 },
{ 0.8117647058823529, 0.8549019607843137, 1.0 },
{ 0.8117647058823529, 0.8549019607843137, 1.0 },
{ 0.807843137254902, 0.8509803921568627, 1.0 },
{ 0.803921568627451, 0.8509803921568627, 1.0 },
{ 0.8, 0.8470588235294118, 1.0 },
{ 0.8, 0.8470588235294118, 1.0 },
{ 0.796078431372549, 0.8431372549019608, 1.0 },
{ 0.792156862745098, 0.8431372549019608, 1.0 },
{ 0.792156862745098, 0.8392156862745098, 1.0 },
{ 0.788235294117647, 0.8392156862745098, 1.0 },
{ 0.7843137254901961, 0.8352941176470589, 1.0 },
{ 0.7843137254901961, 0.8352941176470589, 1.0 },
{ 0.7803921568627451, 0.8313725490196079, 1.0 },
{ 0.7764705882352941, 0.8313725490196079, 1.0 },
{ 0.7764705882352941, 0.8313725490196079, 1.0 },
{ 0.7725490196078432, 0.8274509803921568, 1.0 },
{ 0.7725490196078432, 0.8274509803921568, 1.0 },
{ 0.7725490196078432, 0.8235294117647058, 1.0 },
{ 0.7686274509803922, 0.8235294117647058, 1.0 },
{ 0.7647058823529411, 0.8235294117647058, 1.0 },
{ 0.7647058823529411, 0.8196078431372549, 1.0 }
};
#endif //OPENRGB_AMBIENT_COLORCONVERSION_H