| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > [[additional libraries and templates.htm|Additional Libraries and Templates]] > MenuStyleManager Class > MenuStyleManager Methods >====== MixColors (mix two colors) ====== | [[menustyle imenustyle reference .htm|{{btn_prev_n.gif|Previous page}}]][[additional libraries and templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[refresh refresh menu style .htm|{{btn_next_n.gif|Next page}}]] | | || **MixColors( **//Color1//**, **//Color2//**, **//Percentage//** ),LONG** {{blk2blue.jpg|blk2blue.jpg}} | //Color1// | A LONG value that represents a valid RGB composite color to be mixed with the second color (color1) | | //Color2// | A LONG value that represents a valid RGB composite color to be mixed with the first color (color1) | | //percentage// | A BYTE value that represents the percentage of mix applied to the two colors. | The MixColors method is a PROTECTED method used to calculate and return a composite mix of two colors with a given percentage of mix. Each color passed to this method is a RGB composite color extracted as follows: **InputColor  LONG** **RGBT1       GROUP,OVER(InputColor)** **R            BYTE** **G            BYTE** **B            BYTE** **NotUsed      BYTE** **            END** The mixing of colors is applied using the following formula to all RGB elements: **(RGBT1.R + ((RGBT2.R - RGBT1.R) * pPercentageMix/100))** **Return Value:**   **LONG** **Implementation:** The **MIxColors** method is used by the **SetThemeColors** method to detect and set the proper theme menu style color based on the active theme detected. **See Also:** [[setthemecolors set colors based on theme detected .htm|SetThemeColors ( set colors based on theme detected )]]