private BitmapPalette SetUnusedColorsToBlack()
 {
     for (int i = NumberOfUniqueColors; i < Colors.Length; i++)
     {
         Colors[i] = new BitmapPaletteColor(0, 0, 0, 0);
     }
     return(this);
 }
        public BitmapPalette(byte[] palette)
        {
            // each palette entry must be 4 bytes, therefore modulus of palette length
            // divided by 4 should be 0
            if (palette.Length % 4 != 0)
            {
                throw new ArgumentException($"{nameof(palette)} is an invalid BMP palette - total length must be divisible by 4");
            }

            Colors = new BitmapPaletteColor[palette.Length / 4];
            for (int i = 0; i < palette.Length / 4; i++)
            {
                Colors[i] = new BitmapPaletteColor(palette, i * 4);
            }
        }