158 {
159 if (amountOfOverlay == 0) {
160 return existing;
161 }
162
163 if (amountOfOverlay == 255) {
164 existing = overlay;
165 return existing;
166 }
167
168 fract8 amountOfKeep = 255 - amountOfOverlay;
169
170 fl::u8 huedelta8 = overlay.hue - existing.hue;
171
174 if (huedelta8 > 127) {
176 }
177 }
178
181 if (huedelta8 < 128) {
183 }
184 }
185
187 existing.hue = existing.hue + scale8(huedelta8, amountOfOverlay);
188 } else
189 {
190 huedelta8 = -huedelta8;
191 existing.hue = existing.hue - scale8(huedelta8, amountOfOverlay);
192 }
193
194 existing.sat = scale8_LEAVING_R1_DIRTY(existing.sat, amountOfKeep) +
195 scale8_LEAVING_R1_DIRTY(overlay.sat, amountOfOverlay);
196 existing.val = scale8_LEAVING_R1_DIRTY(existing.val, amountOfKeep) +
197 scale8_LEAVING_R1_DIRTY(overlay.val, amountOfOverlay);
198
199 cleanup_R1();
200
201 return existing;
202}
@ 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.