/****************************************************************************************************

		MCRGBColor.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Arnaud
		Date:	3/17/2005

****************************************************************************************************/

#ifndef __MCRGBColor__
#define __MCRGBColor__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCBasicTypes.h"

class TMCColorRGB;


class TMCRGBColor : public TMCObject
{
public:
	TMCRGBColor(void)																{ rr=0;gg=0;bb=0;}
	TMCRGBColor(uint16 red, uint16 green, uint16 blue) : rr(red),gg(green),bb(blue)	{};
	TMCRGBColor(uint32 argb )														{ ChunkyToRGB(argb); }
	explicit TMCRGBColor(const TMCColorRGB& other);
    
    
	uint32	RGBToChunky() const		   { return 0xff000000 | ((uint32(rr)<<8) & 0x00ff0000 ) | ( uint32(gg) & 0x0000ff00) | ((uint32(bb)>>8) & 0x000000ff); }
	boolean ChunkyToRGB( uint32 argb ) { rr = (argb & 0x00ff0000)>>8; gg = (argb & 0x0000ff00); bb = (argb & 0x0000ff)<<8;  return true;}
	
	boolean operator==(const TMCRGBColor& rhs) const	{return rr == rhs.rr && gg == rhs.gg && bb == rhs.bb;}
	boolean operator!=(const TMCRGBColor& rhs) const	{return !(*this == rhs);}
	
	uint16	rr;
	uint16	gg;
	uint16	bb;
	
	static TMCRGBColor sBlack;
	static TMCRGBColor sWhite;
	static TMCRGBColor sRed;
	static TMCRGBColor sGreen;
	static TMCRGBColor sBlue;
	static TMCRGBColor sStandardGray;
};








#endif
