Sack Library Documentation
ContentsIndexReferenceHome
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.
}
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.