Adds r, g, and b to
red_part
,green_part
, andblue_part
, respectively. Following the addition, ifred_part
,green_part
, and/orblue_part
is greater than 1, it is reduced to 1. If it is less than 0, it is increased to 0.
Let p stand for
red_part
,green_part
, orblue_part
, depending upon which function is used. If 0 <= q <= 1, p is set to q. If q < 0, p is set to 0. If q > 1, p is set to 1.