User Tools

Site Tools


mixcolors_mix_two_colors_.htm
Navigation:  Templates > Guide to all Templates > Additional Libraries and Templates > MenuStyleManager Class > MenuStyleManager Methods >====== MixColors (mix two colors) ====== Previous pageReturn to chapter overviewNext page

MixColors( Color1, Color2, Percentage ),LONG

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 + 1)

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 )

1)
RGBT2.R - RGBT1.R) * pPercentageMix/100
mixcolors_mix_two_colors_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1