MixColors

Top 

 

MixColors( Color1, Color2, Percentage ),LONG

 

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 )