Definition at line 121 of file hsv16.cpp.
121 {
122
126
127 if (s == 0) {
128
130 return CRGB{gray, gray, gray};
131 }
132
133
134 u32 sector = (h * 6) / 65536;
135 u32 sector_pos = (h * 6) % 65536;
136
137
138
140
141
143 if (sector & 1) {
144
145
147 } else {
148
149
151 }
152
153 u32 m = v - c;
154
155 u32 r1, g1, b1;
156 switch (sector) {
157 case 0: r1 = c; g1 =
x; b1 = 0;
break;
158 case 1: r1 =
x; g1 = c; b1 = 0;
break;
159 case 2: r1 = 0; g1 = c; b1 =
x;
break;
160 case 3: r1 = 0; g1 =
x; b1 = c;
break;
161 case 4: r1 =
x; g1 = 0; b1 = c;
break;
162 default: r1 = c; g1 = 0; b1 =
x;
break;
163 }
164
165
169
170 return CRGB{R, G, B};
171}
LIB8STATIC_ALWAYS_INLINE uint8_t map16_to_8(uint16_t x)
LIB8STATIC_ALWAYS_INLINE uint16_t map32_to_16(uint32_t x)
Representation of an RGB pixel (Red, Green, Blue)
References fl::HSV16::h, map16_to_8(), map32_to_16(), fl::HSV16::s, fl::HSV16::v, and x.
Referenced by fl::HSV16::ToRGB().