public override void Write(string fileOut) { // Only accept one palette Color[] pal = palette[0]; Helper.BinaryWriterBE bw = new Helper.BinaryWriterBE(fileOut); bw.Write((ushort)0x00); // Version 0 bw.Write((ushort)pal.Length); // Number of colors for (int i = 0; i < pal.Length; i++) { bw.Write((ushort)0x00); // Color spec set to 0 bw.Write((ushort)pal[i].R); // Red component bw.Write((ushort)pal[i].G); // Green component bw.Write((ushort)pal[i].B); // Blue component bw.Write((ushort)0x00); // Always 0x00, not used } bw.Flush(); bw.Close(); }
public override void Write(string fileOut) { // Only accept one palette Color[] pal = palette[0]; Helper.BinaryWriterBE bw = new Helper.BinaryWriterBE(fileOut); bw.Write((ushort)0x00); // Version 0 bw.Write((ushort)pal.Length); // Number of colors for (int i = 0; i < pal.Length; i++) { bw.Write((ushort)0x00); // Color spec set to 0 bw.Write((ushort)pal[i].R); // Red component bw.Write((ushort)pal[i].G); // Green component bw.Write((ushort)pal[i].B); // Blue component bw.Write((ushort)0x00); // Always 0x00, not used } bw.Flush(); bw.Close(); }