78 {
79 if (amountOfOverlay == 0) {
80 return existing;
81 }
82
83 if (amountOfOverlay == 255) {
84 existing = overlay;
85 return existing;
86 }
87
88 fract8 amountOfKeep = 255 - amountOfOverlay;
89
90 fl::u8 huedelta8 = overlay.hue - existing.hue;
91
94 if (huedelta8 > 127) {
96 }
97 }
98
101 if (huedelta8 < 128) {
103 }
104 }
105
107 existing.hue = existing.hue + scale8(huedelta8, amountOfOverlay);
108 } else
109 {
110 huedelta8 = -huedelta8;
111 existing.hue = existing.hue - scale8(huedelta8, amountOfOverlay);
112 }
113
114 existing.sat = scale8_LEAVING_R1_DIRTY(existing.sat, amountOfKeep) +
115 scale8_LEAVING_R1_DIRTY(overlay.sat, amountOfOverlay);
116 existing.val = scale8_LEAVING_R1_DIRTY(existing.val, amountOfKeep) +
117 scale8_LEAVING_R1_DIRTY(overlay.val, amountOfOverlay);
118
119 cleanup_R1();
120
121 return existing;
122}
u8 fract8
Fixed-Point Fractional Types.
@ 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.