/*******************************************/
/*                                         */
/* colors.cpp                              */
/*                                         */
/* scol colors primitives                  */
/*                                         */
/* Loïc Berthelot, CryoNetworks, june 2002 */
/*                                         */
/*******************************************/


#include "colors.h"





//
// separate RGB
//
void _COLOR_I_TO_BGR (int color, unsigned char *b, unsigned char *g, unsigned char *r)
{
	*b = (color>>16) &0xFF;
	*g = (color>>8) &0xFF;
	*r = color & 0xFF;
}

//
// assemble RGB
//
int _COLOR_BGR_TO_I (unsigned char b, unsigned char g, unsigned char r) 
{
	return ( ((b <<16) & 0xFF0000)  |  ((g <<8) & 0xFF00)  |  (r & 0xFF) );
}





