private static Palette[] LoadPalettes() { var palettes = new Palette[15]; palettes[0] = palette0; palettes[1] = palette1; palettes[2] = palette2; palettes[3] = palette3; palettes[4] = palette4; palettes[5] = background; foreach (var index in Enumerable.Range(0, 8)) palettes[6 + index] = background.MoveRange(index * 16, 16, 224); palettes[14] = new Palette(palette4.data); foreach (var index in Enumerable.Range(0, 16)) palettes[14].SetColor(240 + index, greyscale[index]); return palettes; }
private Palette MoveRange(int sourceIndex, int count, int destinationIndex) { var newPalette = new Palette(data); foreach (var index in Enumerable.Range(0, count)) newPalette.MoveColor(sourceIndex + index, destinationIndex + index); return newPalette; }