10 users online: ASSATAKKU, CrystalClear, Gregor, I'm Poppy, kirito86, Nitrogen, ocked, rafaelfutbal,  Segment1Zone2, Zavok - Guests: 888 - Bots: 157
Users: 65,116 (2,295 active)
Latest user: Ananga78

Lunar Magic's Palette Editor

Lunar Magic

Update - (August 29th, 2021): Updated formatting in certain areas to better match an upcoming Overworld tutorial, as it'll likely link to this.
Update - (June 12th, 2020): Uploaded images to a better host (aka My Files, not imgur)
Update - (May 3rd, 2017): Added a paragraph to the Palette Mask section to further clarify the importing/exporting process. Pictures may be added in the future if needed.

Welcome! Whether you're a beginner, or an experienced user who simply wants to relearn a couple things, this tutorial aims to teach you in a brief manner how to use one of Lunar Magic's many editors—the Palette Editor. For good reason, too. Levels are made up of more than just the placed sprites and blocks, after all! The palette, if utilized correctly, can play a very important part in giving your level a particular 'feeling', or atmosphere, which can make it even more unique than they would be otherwise. Palettes can change a boring looking cave level into a chilly, ice-coated cavern, or if that's not what you're going for, then they can also change said cave level into a hot, treacherous volcano. These are only a couple of examples, but you get the point.

Just as a fair warning, though: if you clicked this tutorial in the hopes of learning how to make aesthetically pleasing palettes, then you're sadly out of luck. Such a subject generally requires at least a barebones understanding of color theory, and I am by no means experienced in that field. The community's here for a reason, so feel free to ask questions and get feedback from your fellow users.

With that out of the way, let's delve into the Palette Editor!

Welcome to the Lunar Magic Palette Editor!
Once you have your rom opened in Lunar Magic, click on the #lm{pal} in the center of the toolbar. This is what you'll see. (Note: if you've edited the level before, or if you're not on Level 105, then the block of colors on the left may be slightly different. Pay no mind to this for now.)

This interface may seem a little complex at a first glance, but once you get the hang of it and know how everything works, you'll find it's actually pretty simple. It's not too gimmicky, and aside from the coin's color it's also not very flashy. There are no pointlessly complex, yet specific features that only help certain users, so it's all easy to learn—even for beginners. Allow me to break down what the Palette Editor can accomplish.

) This previously mentioned “block of colors” is the CURRENT LEVEL'S PALETTE aside from the Back Area Color, which is located separately from the rest of the palette. For levels, the whole palette is split into 16 (0-F) palettes with 16 (0-F) colors in each row. Well—15, actually—because the first color of every row is transparency, and as far as I'm aware you cannot effectively alter it. Of these 16 palette rows, the top 8 rows (palettes 0 through 7) are used mainly for the Foreground and Background, like pipes and blocks. The 8 rows at the bottom (palettes 8-15) are used for sprites, including Mario himself. Keep that in mind.

Editing most of these is pretty simple (if you look in the bottom right corner of the menu it even tells you the controls!), and to sum it all up:
  • Left-click on a color to edit.

  • F3 while hovering over any pixel in any open window to copy its color. (Note that this can actually be used on other open programs, though the Palette Editor window must be active within Lunar Magic during this.)

  • Control + left-click on a color to copy, and control + right-click (or just simply right-click) on another color to paste over it.

  • Control + alt + left-click on a color to copy its entire row, and control + alt + right-click on another color to paste the entire row over it.

  • Alt + right-click on two colors to set the end points of a gradient. For example, say you were editing the sky, and wanted to make a nice transition from a light blue to a darker shade of blue. To accomplish this you would first choose the lightest color of the sky, or the beginning of the gradient, like so:

  • Then, you would choose the darkest blue in the sky, or the last color in the gradient:

    After that, you would then alt + right-click on both of the colors (it doesn't matter which order you click on them). It should show you something like this:

    Voila! And just like that, the program automatically chose a selection of in-between colors between the two on the outside, giving you a nice transition from light to dark. You're not limited to just five colors either, you can do as many as want, even so far as to stretch across several palettes*. They don't even have to be the same color!**

    *Be aware though that making gradients that long generally isn't advised, since you would be potentially overwriting the palettes of various other SMW elements, and very rarely do you need that gradual of a transition, anyway.

    **Do use caution when choosing to do this, as some colors simply do not fade together in a way that looks visually appealing.

) Next, the numerous dropdown boxes you see in the middle of the right side of the editor are collectively the LEVEL HEADER SETTINGS. These allow you to choose from eight different preset options of colors for the foreground, background, back area (that area behind the background itself, which is usually the sky's color), and the sprites, or you can even separately edit each of the presets to your liking. One thing should be noted, however.

The listed “Mario Palette” is somewhat of an exception in that instead of having the eight presets that the other elements have, this one just lists the palettes for the Mario, Luigi, and their fire flower variants so you can edit them. More on these below.

) Checking this box ENABLES THE CUSTOM PALETTE for the current level. That sounds simple enough, but it actually changes quite a lot for editing palettes. For one, this grays out the previously mentioned level header settings, which makes it so editing any part of the level's palette does not actually alter any of those presets for other levels. This is great for when you want to give the level a unique flair without the risk of changing how others look in the process, or when you're using custom graphics that require their own palette.

Second, saving any changes to the palette is done slightly differently now. Instead of saving within the Palette Editor menu itself like you did previously, changes to the palette are now saved alongside any other changes to the level such as placing/moving objects or sprites. Use the #lm{save} icon in the top left of the main window's toolbar.

Unfortunately, a side effect of how Mario and Luigi's palette acts—in that it (Palette 8) changes independently of the rest of the level palette when swapping characters, or when switching to the fire power's colors—enabling this setting actually makes it so custom palettes don't work for colors 6-F, so they'll always change back to the defaults. For example, if you made Mario all black like this:

With custom palette enabled, he would actually show up like this:

If you want to use custom palettes for Mario and Luigi, there is a solution—though it's not recommended for beginning romhackers—consider using this patch.

) The #lm{rel} icon will RELOAD THE PALETTE, UNDOING ANY CHANGES YOU'VE MADE SINCE THE LEVEL WAS LOADED. This includes making use of any of the previously mentioned features. Ignores saving. Once you switch to another level, though, then it can't revert back. Useful for if you're experimenting with palettes.

) These two are inverses of eachother: #lm{undo} UNDOES UNSAVED CHANGES YOU'VE MADE. #lm{redo} REDOES UNSAVED CHANGES YOU'VE MADE, almost exclusively used to restore any progress previously undone by the #lm{undo} icon. However, unlike number four, these only go back (and forward) a single step at a time. For example, if you:

  • 1. Made a gradient
  • 2. Changed a red color to be slightly darker
  • 3. Replaced a blue with a yellow color

  • Then pressing #lm{undo} once would revert your most recent change, number three, and change that yellow back to blue. At that point, pressing it again would undo number two, and make the red brighter again—alternatively, pressing #lm{redo} would change the blue back to yellow again.

) The #lm{maskmode} icon ENABLES THE PALETTE MASK EDITING MODE. This mode dictates what colors will actually be exported if you choose to export the level's palette to a file (which will be brought up in just a moment). Clicking it won't change anything visually at first, but when you click on any of the colors now you should see that certain color get crossed out. That X means that the color won't be exported if you choose to do so.

Keep in mind that palette masks do not save with your palette, nor with the level. To keep any changes made, export the current palette. This will export the level's palette as a file called (Insert name here).pal, and a similarly named (Insert name here).palmask will be created right next to it. Of these two, only the .pal file needs to be imported into whatever level you intend on using it for—as long as the .palmask is still named identically to the .pal and is in the same folder, it will be automatically applied.

A useful feature for if you want to transfer only parts of a level's custom palette to another level, and it's even necessary to use if you ever create and distribute your own custom graphics.

) The #lm{maskmenu} icon OPENS THE PALETTE MASK EDITING MENU. There'll be only two options shown, and they're fairly self-explanatory: Enable all colors for export gets rid of any 'X's you may have already set on the level's palette mask. Disable all colors for export does the opposite and crosses off every single color in the current palette.

) The #lm{exppal} icon EXPORTS THE CURRENT LEVEL'S PALETTE TO A FILE. The previously mentioned Palette Mask is taken in to account in this case. Opposite of that is the #lm{imppal}, which IMPORTS A PALETTE FILE INTO THE CURRENT LEVEL. Just keep in mind that this automatically enables the custom palette. Useful for when you want to recycle a previously used custom palette from a different level, or for when you're using certain custom graphics.

) Very similar to what's listed for number eight, though with a few very notable differences. Since we're talking about Shared Palettes in this case, and not a Custom Palette—exporting the palette to a file also saves what colors are stored in each of the presets. Not as commonly useful as number eight, but if you're transferring your project over to another rom, or if you're the head of a collaboration hack, then it's perfect for you.

) The #lm{rgbrel} icon UNDOES ANY UNSAVED CHANGES TO THE SHARED PALETTE. Similar in function to #lm{rel} except that it can't revert any changes once the palette's saved, and that enabling the custom palette will render it unusable.

) The #lm{save} icon SAVES ANY CHANGES MADE TO THE SHARED PALETTE. ...mostly. Changes not saved by this are any made with the Palette Mask Editing Mode, and what presets are chosen for a level. Like with number ten, enabling the custom palette will render this feature unusable.

) Not too important, but this little “<” box essentially resizes the Palette Editor to be just the block of colors. Purely preference, I suppose, but it's an option regardless.

Some Special Thanks
Just wanted to give a quick thanks to:
- FuSoYa for Lunar Magic itself, and all the work he's put into it over the years.
- SMWCentral for being a part of my life for almost eight years at this point.

Finishing Statement
Right off the bat, I just want to say that I hope this helps any beginning romhackers at least a little bit. Being my first tutorial, my formatting could definitely use some work, though considering a lot of the features I tried to cover had really simple, almost self-explanatory uses—there wasn't too much I could say for some of them without dragging it on too much. And if have some constructive criticism I could use to try and improve this tutorial further, please let me know! If you have any questions, feel free to leave them as a reply and hopefully somebody can answer.

~ Veck.

Really Nice tutorial! It did help a lot ^^
Thanks for this. I’m brand new to Lunar Magic, and have only been playing hacks a little over a year, so this is ALL new to me! Looking forward to learning more!
How do you save shared palettes everytime I try to import a shared palette it just turns into a purple mess
Are you opening shared palettes with the #lm{imppal} button? You should use the #lm{impsha} button to open shared palettes instead.

How do I change the colour of the player name ("Mario" and "Luigi" in vanilla) in the HUD?
Originally posted by Jephro512
How do I change the colour of the player name ("Mario" and "Luigi" in vanilla) in the HUD?

You'll need to change color A for Mario or color B for Luigi in palette 0.
If you change color A it will also change the color of the bonus star ⭐icon too.

The tutorial you made is very useful and easy to understand, but I had a problem. When I edited a little of Yoshi's palette, in the parts where there is no palette, with the color black, everything worked well, in all phases, but, with regard to the animation for entering the castle and the Ghost House, Yoshi It remains with its original palette, as there is no level in Lunar Magic that changes the palette of these animations. Does anybody know how to solve this? If so, if you could help me I would appreciate it.

Originally posted by calanguinho543
The tutorial you made is very useful and easy to understand, but I had a problem. When I edited a little of Yoshi's palette, in the parts where there is no palette, with the color black, everything worked well, in all phases, but, with regard to the animation for entering the castle and the Ghost House, Yoshi It remains with its original palette, as there is no level in Lunar Magic that changes the palette of these animations. Does anybody know how to solve this? If so, if you could help me I would appreciate it.

This one can get a bit complicated if you want to use that half. The No Yoshi intros don't have a proper level, so the only way you can modify their palettes is by modifying the global palettes (edit the palette while the "enable custom palette for this level" checkbox is unchecked). However, the global palettes don't have access to that black color area as there's not anything being loaded there, so they can't be used.

The alternative is to disable the original No Yoshi entrance, and instead make a custom one where you can modify that palette. You can do that with this block (why a block and not UberASM? not entirely sure).

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer

Lunar Magic