159 {
160 if (amountOfOverlay == 0) {
161 return existing;
162 }
163
164 if (amountOfOverlay == 255) {
165 existing = overlay;
166 return existing;
167 }
168
169 fract8 amountOfKeep = 255 - amountOfOverlay;
170
171 fl::u8 huedelta8 = overlay.hue - existing.hue;
172
175 if (huedelta8 > 127) {
177 }
178 }
179
182 if (huedelta8 < 128) {
184 }
185 }
186
188 existing.hue = existing.hue + scale8(huedelta8, amountOfOverlay);
189 } else
190 {
191 huedelta8 = -huedelta8;
192 existing.hue = existing.hue - scale8(huedelta8, amountOfOverlay);
193 }
194
195 existing.sat = scale8_LEAVING_R1_DIRTY(existing.sat, amountOfKeep) +
196 scale8_LEAVING_R1_DIRTY(overlay.sat, amountOfOverlay);
197 existing.val = scale8_LEAVING_R1_DIRTY(existing.val, amountOfKeep) +
198 scale8_LEAVING_R1_DIRTY(overlay.val, amountOfOverlay);
199
200 cleanup_R1();
201
202 return existing;
203}
@ SHORTEST_HUES
Hue goes whichever way is shortest.
@ LONGEST_HUES
Hue goes whichever way is longest.
@ FORWARD_HUES
Hue always goes clockwise around the color wheel.
@ BACKWARD_HUES
Hue always goes counter-clockwise around the color wheel.
u8 fract8
Fixed-Point Fractional Types.