Destructively modifies one color, blending in a given fraction of an overlay color.
365{
366 if( amountOfOverlay == 0) {
367 return existing;
368 }
369
370 if( amountOfOverlay == 255) {
371 existing = overlay;
372 return existing;
373 }
374
375 fract8 amountOfKeep = 255 - amountOfOverlay;
376
377 uint8_t huedelta8 = overlay.hue - existing.hue;
378
381 if( huedelta8 > 127) {
383 }
384 }
385
388 if( huedelta8 < 128) {
390 }
391 }
392
394 existing.hue = existing.hue +
scale8( huedelta8, amountOfOverlay);
395 }
396 else
397 {
398 huedelta8 = -huedelta8;
399 existing.hue = existing.hue -
scale8( huedelta8, amountOfOverlay);
400 }
401
406
408
409 return existing;
410}
@ LONGEST_HUES
Hue goes whichever way is longest.
@ FORWARD_HUES
Hue always goes clockwise around the color wheel.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
@ BACKWARD_HUES
Hue always goes counter-clockwise around the color wheel.
uint8_t fract8
ANSI: unsigned short _Fract.
LIB8STATIC_ALWAYS_INLINE void cleanup_R1()
Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...