Documentation Project 1
ContentsIndexHome
Example

 

Compute a color that is halfway from blue to green. (if the total distance is 100, then 50 is half way).

CDATA blue_green = ColorAverage( blue, green, 50, 100 );

 

Compute a color that's mostly red.

CDATA red_blue_green = ColorAverage( blue_green, red, 240, 255 );

 

Iterate through a whole scaled range...

int n;
for( n = 0; n < 100; n++ )
{
    CDATA scaled = ColorAverage( BASE_COLOR_WHITE, BASE_COLOR_BLACK, n, 100 );
    // as n increases, the color slowly goes from WHITE to BLACK.
}
Copyright (c) 2010. All rights reserved.