I want to change the color palette of my MakeCode Arcade project dynamically. There seem to be some extensions that can do that for me, but documentation is lacking and I don’t understand how to use it.
Is there any documentation or extensions that can help me change the color palette dynamically easily?
This is what I thought of when you first asked me, but there is one major drawback - You wouldn’t see the color changes immediately so you wouldn’t know which color is being changed.
The second one you mentioned (numbers 1-15 w/ a color picker field editor along the lines of the chrome one here) is what I’ve been wanting to do, but just haven’t had time / forgotten about doing it when I have had time. Might be a good thing to start over the weekend, now that I’m stuck at home…
The last one you mentioned should be trivial to add, and I suppose a version with slots for values instead of a field editor will be helpful for changing colors programmatically anyways, so I’ll take a look at doing that real quick It’s an extension in a separate repo anyways so it can be updated without a release of the editor
Hm, that might be a little harder looking at it; no problem implementation wise, but it would add a dependency on the neopixel light for just those two blocks, and would probably be harder to find / interact with across two different categories; for now I think I’ll duplicate those in the color extension and we can take a look deduping that in the future (changing that package requires a full update to arcade itself). Thanks for pointing that out though!
No problem! Thanks for helping design the blocks / confirming what the design of the field editor block should ideally be!
Just added the blocks to the color fading extension, you’ll need to update it to get them. Sorry for the delay, was at the store for a bit getting some stuff for dinner Please let me know if they give you any trouble, haven’t built anything with it besides a trivial test example but I’ll probably play around with it this weekend. (also need to figure out why the set color palette and fade from blocks broke, I think I had checked them just before the last release but for some reason the builtin palettes aren’t loading as a drop down anymore… weird this should be fixed as well with v0.1.1, minor internal bug I could work around )
Only 16 colors (including clear) can be on the screen at once - if you change colors it will change for all sprites.
One workaround, if you can find a few colors that you can live without, is to use those indices as special placeholder colors for the sprites and only ever change those - I do something like that for the team colors in https://arcade.makecode.com/nfl - leave all but 4 colors as one color palette, and change the last 4 based on the teams that are chosen.