Step One: Don't Break it

Step One: Don’t Break aseprite.
Step Two: Proceed on breaking aseprite:

1 Like

If you are gonna to implement color groups, please be really careful, it’s a huge feature and it might be easier for me to accept your PRs if each patch is separated e.g. 1) first one PR implementing the document/model layer (src/doc), 2) other PR implementing the UI, 3) other PR implementing the .aseprite format (and maybe in that order), 4) other PR for data recovery persistence.

I didn’t plan to just give you a ticking time bomb, but I was going to ask you where I should probably start. Navigating aseprite source is a bit harder for me than usual.

You can start with the doc module. We have a Palette class with the color entries. A Sprite class with the palette. I guess Sprite needs a new colorGroups() fields, anyway I’m not sure if this new ColorGroups class should be something related to the Sprite or to the Palette, e.g. the palette depends on the current frame (it’s not supported in the UI yet, but internally Aseprite supports palette shifting animation). If the palette can be modified on each frame, each palette might contain a different set of ColorGroups. Something to think about it.

The doc module doesn’t handle undo stuff, the undo history is in the app module, in the app::Document::undoHistory(). The undo/redo actions are stored as a series of small Cmd instances, these are created in bigger UI Commands (e.g. DeselectMask).

I think undoing palette groups is gonna be last on my plate. I rather see if I can even get it to work :slight_smile:

Oh please implement this. I am very picky about my palette, and I like to have them in groups… And when I have to add another one, it’s very much a pain to bring that new color to the group it belongs… Currently I have to:

  1. Add two colors…
  2. The last color, will be the ‘new color’.
  3. Select a range of colors, and copy it.
  4. Paste it and move them all one over.
  5. Remap (thank you for remap!)
  6. Copy the last color into the space of colors it opened up (should be next to where I wanted the group)
  7. Select the two palettes I want to swap with left and right mouse click
  8. Do a shift + R to replace those colors… ON EVERY SINGLE FRAME OF ANIMATION
  9. Rest.

Would really be nice to just add a new color to a group tbh lol

1 Like

You can select all frames of animation before doing shift + R and the color of all of them will be replaced at once! I hope it helps a bit :smiley: