public static Bgr IntToBgr(int color)
{
if (color > 0xFFFFFF)
{
throw new IndexOutOfRangeException("Color must be <= 0xFFFFFF");
}
int blue = color & (0xFF0000);
int green = color & (0x00FF00);
int red = color & (0x0000FF);
return new Bgr(blue, green, red);
}