75 {
76 if (amountOfOverlay == 0) {
77 return existing;
78 }
79
80 if (amountOfOverlay == 255) {
81 existing = overlay;
82 return existing;
83 }
84
85 fract8 amountOfKeep = 255 - amountOfOverlay;
86
87 uint8_t huedelta8 = overlay.hue - existing.hue;
88
91 if (huedelta8 > 127) {
93 }
94 }
95
98 if (huedelta8 < 128) {
100 }
101 }
102
104 existing.hue = existing.hue +
scale8(huedelta8, amountOfOverlay);
105 } else
106 {
107 huedelta8 = -huedelta8;
108 existing.hue = existing.hue -
scale8(huedelta8, amountOfOverlay);
109 }
110
115
117
118 return existing;
119}
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 ...
@ 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.