SilverScreen Solid Modeler

ToColorIndex method

ToColorIndex method

Previous topic Next topic  

ToColorIndex method

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

int ToColorIndex();

 

 

 

 

 




Synopsis

using SilverSharp;

 

The ToColorIndex method converts a SilverSharp.SS_RGB object to a color index into the standard SilverScreen palette.

 

 

Parameters

none

 

 

Return Value

ToColorIndex returns the closest color index into the standard SilverScreen palette for the SilverSharp.SS_RGB object.

 

 

Remarks

Color indexes were common to MS-DOS-era functions, and there are some API routines that survive which use them.

 

 

See Also

SS_RGB, rgb_to_color

 

 

Example

The following code creates a SilverSharp.SS_RGB object and converts it to a color index:

 

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 SS_RGB obj_color = new SS_RGB(255, 128, 64);

 

 . . .

 

 SC.paint_entity("\\obj1", obj_color.ToColorIndex());