예제 #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);
        }
예제 #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);
        }
예제 #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;
 }
예제 #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;
 }