public static string CreateJson(
            PaletteOffsetCollections collections,
            Options options)
        {
            var offsets = new List <int[]>();

            foreach (var array in collections.GetCollections(options))
            {
                offsets.Add(array.ToArray());
            }

            var result = JsonSerializer.Serialize(offsets);
            var sb     = new StringBuilder();

            sb.Append('[');
            sb.Append(Environment.NewLine);
            foreach (var match in OffsetFormat.Matches(result))
            {
                sb.Append("  ");
                sb.Append(match);
                sb.Append(Environment.NewLine);
            }

            sb.Append(']');
            return(sb.ToString());
        }
        public void RebuildCollections()
        {
            PaletteEditorsInternal.Clear();
            var offsetCollection = PaletteOffsetCollections.GetCollections(Options);

            foreach (var offsets in offsetCollection)
            {
                PaletteEditorsInternal.Add(new PaletteEditor(Rom, offsets));
            }
        }