public static ColorMixer FromHex(int hexColor) { ColorMixer c = new ColorMixer { Red = (float)((hexColor & 16711680) >> 16) / 255, Green = (float)((hexColor & 65280) >> 8) / 255, Blue = (float)(hexColor & 255) / 255 }; return(c); }
public static ColorMixer FromHexAndAlpha(int hexColor, float alpha) { ColorMixer c = new ColorMixer { Red = (float)((hexColor & 16711680) >> 16) / 255, Green = (float)((hexColor & 65280) >> 8) / 255, Blue = (float)(hexColor & 255) / 255, Alpha = alpha }; return(c); }
public static ColorMixer FromHexAndAlpha(int hexColor, float alpha) { ColorMixer c = new ColorMixer { Red = (float)((hexColor & 16711680) >> 16) / 255, Green = (float)((hexColor & 65280) >> 8) / 255, Blue = (float)(hexColor & 255) / 255, Alpha = alpha }; return c; }
public static ColorMixer FromHex(int hexColor) { ColorMixer c = new ColorMixer { Red = (float) ((hexColor & 16711680) >> 16)/255, Green = (float) ((hexColor & 65280) >> 8)/255, Blue = (float) (hexColor & 255)/255 }; return c; }