public static int GetColorIndex(Color color, Palette palette) { RomColor[] colors = new RomColor[Palette.ColorCount]; for (int i = 0; i < colors.Length; i++) { colors[i] = palette[i]; } return(Utilities.GetColorIndex(color, colors)); }
public static int GetColorIndex(RomColor color, RomColor[] colors) { int colorIndex = -1; for (int i = 0; i < colors.Length; i++) { if (colors[i] == color) { colorIndex = i; break; } } if (colorIndex == -1) { colorIndex = Utilities.GetClosestColorIndex(color, colors); } return(colorIndex); }