MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / CMYK

Method CMYK

libraries/Kelvin2RGB/Kelvin2RGB.cpp:179–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179uint32_t Kelvin2RGB::CMYK()
180{
181 float k = _red;
182 if (k < _green) k = _green;
183 if (k < _blue) k = _blue;
184
185 float t1 = k;
186 k = 1 - k;
187 float t2 = 255.0 / (1 - k);
188
189 uint32_t c = (t1 - _red ) * t2;
190 uint32_t m = (t1 - _green) * t2;
191 uint32_t y = (t1 - _blue ) * t2;
192
193 return (c << 24) + (m << 16) + (y << 8) + (k * 255);
194}
195
196
197uint32_t Kelvin2RGB::BGR()

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64