SilverScreen Solid Modeler

MAKE_RGB

MAKE_RGB

Previous topic Next topic  

MAKE_RGB

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

 

RGB MAKE_RGB ( int color_index, int red, int green, int blue )

 

int color_index;   // An index into the standard palette (not necessary)

int red;           // An integer value between 0 and 255

int green;         // An integer value between 0 and 255

int blue;          // An integer value between 0 and 255

 

 




Synopsis

#include "silver.h"

 

The MAKE_RGB macro creates an RGB data type that stores color information.

 

 

Parameters

color_index is an index into the standard palette. It has become irrelevant and should be zero.

 

red is the red component of an RGB value. When red is 0 there is no red contribution. When red is 255 the red contribution is maximized.

 

green is the green component of an RGB value. When green is 0 there is no green contribution. When green is 255 the green contribution is maximized.

 

blue is the blue component of an RGB value. When blue is 0 there is no blue contribution. When blue is 255 the blue contribution is maximized.

 

 

Return Value

MAKE_RGB returns an RGB type that stores color information.

 

Remarks

The color_index parameter was preserved for legacy purposes, and should be 0, since SilverScreen stores all of its color information as rgb values.

 

 

See Also

color_to_rgb, rgb_to_color, RED_COLOR, GREEN_COLOR, BLUE_COLOR

 

 

Example

The following lines of code demonstrate how to use MAKE_RGB to represent some common colors:

 

C / C++ Code

 

 #include "silver.h

 

 . . .

 

 RGB red   = MAKE_RGB(0, 255, 0, 0);

 RGB green = MAKE_RGB(0, 0, 255, 0);

 RGB blue  = MAKE_RGB(0, 0, 0, 255);

 RGB white = MAKE_RGB(0, 255, 255, 255);

 RGB black = MAKE_RGB(0,0,0,0);