Ejemplo n.º 1
0
 public PaletteQuantizer(Color2[] palette = null) : base(true)
 {
     if (palette == null)
     {
         Color2[]      constants = Color2.WebSafeColors;
         List <Color2> safe      = new List <Color2> {
             default(Color2)
         };
         foreach (Color2 c in constants)
         {
             Color2 packed = Color2.FromVector4(c.ToVector4());
             safe.Add(packed);
         }
         colors = safe.ToArray();
     }
     else
     {
         colors = palette;
     }
 }