2.1.6.33 okutil_ocolor_LT_color_convert


Description

Convert between LabTalk color and OC OCOLOR.LabTalk color is 1-offset for indexed color and has support for indexed access to custom colors

Syntax

int okutil_ocolor_LT_color_convert( int nn, BOOL bOColorToLT )

Parameters

nn
[input] color
bOColorToLT
[input] true to convert from OCOLOR to LabTalk color, false to convert from LabTalk Color to OCOLOR

Return

return either OCOLOR or LabTalk color depending on bOColorToLT

Examples

EX1

void okutil_ocolor_LT_color_convert_ex1()
{
	int nColor = 10;	
	//convert from OCOLOR to LabTalk color 
	//output:When  OCOLOR value is 10  the LabTalk color value converted is 11 
	int nRet = okutil_ocolor_LT_color_convert(nColor , true );
	printf("When  OCOLOR value is %d  the LabTalk color value converted is %d \n", nColor, nRet);
	//convert from LabTalk Color to OCOLOR
	//output:When  LabTalk color value is 10  the OCOLOR value converted is 9 
	nRet = okutil_ocolor_LT_color_convert(nColor , false );
	printf("When  LabTalk color value is %d  the OCOLOR value converted is %d \n", nColor, nRet);
}

Remark

See Also

Header to Include

origin.h

Reference