76 {
77 if (amountOfOverlay == 0) {
78 return existing;
79 }
80
81 if (amountOfOverlay == 255) {
82 existing = overlay;
83 return existing;
84 }
85
86 fract8 amountOfKeep = 255 - amountOfOverlay;
87
88 fl::u8 huedelta8 = overlay.hue - existing.hue;
89
92 if (huedelta8 > 127) {
94 }
95 }
96
99 if (huedelta8 < 128) {
101 }
102 }
103
105 existing.hue = existing.hue +
scale8(huedelta8, amountOfOverlay);
106 } else
107 {
108 huedelta8 = -huedelta8;
109 existing.hue = existing.hue -
scale8(huedelta8, amountOfOverlay);
110 }
111
116
118
119 return existing;
120}
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.
u8 fract8
Fixed-Point Fractional Types.