module gedo.video.color;



typedef uint Color;



public Color rgba(ubyte r, ubyte g, ubyte b, ubyte a)
{
	return cast(Color)(r | (g<<8) | (b<<16) | (a<<24));
}


public Color setA(Color c, ubyte a)
{
	return cast(Color)((c & 0x00FFFFFF) | (a<<24));
}


public void split(Color c, out ubyte r, out ubyte g, out ubyte b, out ubyte a)
{
	r = c & 0xFF;
	g = (c>>8) & 0xFF;
	b = (c>>16) & 0xFF;
	a = (c>>24) & 0xFF;
}


const Color WHITE  = rgba(255, 255, 255, 255);
const Color BLACK  = rgba(  0,   0,   0, 255);
const Color RED    = rgba(255,   0,   0, 255);
const Color GREEN  = rgba(  0, 255,   0, 255);
const Color BLUE   = rgba(  0,   0, 255, 255);
const Color YELLOW = rgba(255, 255,   0, 255);

