public static IntToBgr ( int color ) : Bgr | ||
color | int | an integer between 0 and 0xFFFFFF inclusive |
return | Bgr |
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);
}