I am converting the RGB value to one with the following:
public static int RGBtoInt(int red, int greed, int blue)
{
return blue + green + (green * 255) + (red * 65536);
}
but struggles to write a reverse method that takes an integer and returns the individual RGB components.
Something of a thematic nature:
public static Vector3 IntToRgb(int value)
{
return new Vector3(red, green, blue);
}
The method Color.FromArgb(int)does not create the RGB color that I need.
The function RGBtoIntabove matches the integer RGB values returned by OpenGL, and I'm looking for the opposite method. In the same conversion method here .
source
share