Articles

Extracting the Components of a Color - If you need to determine the amount of red, green, or blue in an RGB color value, use the GetRed, GetGreen, and GetBlue functions.

Tips

TIP - To calculate the average of two RGB color values, you can use either of these two formulas:

The first formula always rounds up, whereas the second formula always rounds down. For example, if Color1 = &H000000 (black) and Color2 = &HFFFFFF (white), then Average1 = &H808080 and Average2 = &H7F7F7F.

As a special case, you can lighten or darken a color by averaging it with white or black:

1