Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
 }