Palette-Maker

0
0
Published 2023-06-12


A tool for creating palettes! Supports the default 16 colors and the secret extra-set of 16 bonus colors (you can use items from both in your palette, but you can only select 16 colors in total).

BUILDING A PALETTE

Click a color in the 4x4 grid to select/deselect it. Click the Default/Alternate buttons on the left (or press Z) to switch the picker-grid between default colors and "special dark" colors.

Click and drag colors you've already chosen (at the top) to reorder them.

EXPORTING YOUR PALETTE TO THE CLIPBOARD

To export your palette, click the Copy button (see note below). This exports your palette as a single line of Lua, which you can paste into another pico8 editor (or a text file). You can put this line of Lua into your _INIT() function, or at the very top of your script, or at whatever point where you want the palette to change.

Example output:

> (NOTE!) If you're running the palette maker on the BBS, when you click the Copy button, you'll get a popup telling you how to complete the operation - at the time of writing, pico8 pops up a red message telling you to press ctrl-C or cmd-C to complete the copy-operation - so for windows-web, the export process is to click Copy and then hit Ctrl+C, then go to your other app/window and hit Ctrl+V. If you want to skip that extra step, run the palette maker locally (you can use the command LOAD #PALETTE_MAKER from the pico8 entry screen to download it) - in the local editor, the Copy button alters your clipboard contents immediately.

AUTO-SORTING YOUR PALETTE

Click the SORT button to attempt to auto-sort your palette - for simple palettes, like monochrome stuff, this should work "as expected," producing a ramp from dark to bright. For stranger palettes, it'll do its best to minimize the HSV difference and acceleration between neighbors in HSV space (the cart's thumbnail is the full 16-color default palette, after sorting with this method).

TWEETJAM-EXPORT MODE

Click the blue twitter-bird button to toggle tweetjam-export mode, which always produces a shorter output for the same palette, compared to the default (more-legible) output mode. Tweetjam-export is also relevant if you're optimizing tokens: no matter how many colors your palette includes, the output in tweetjam mode will be 2 tokens. If you're going for lowest-possible char-count: adding 1 extra default-palette color costs 1 extra byte, but adding 1 extra alt-palette color costs 2 extra bytes, because it gets encoded as an emoji.

Example output in tweetjam-mode:

SHOUTOUTS

If you'd like to edit your palette inside the context of your actual game, you may be interested in @BoneVolt's utility, Painto-8 Lite!

Special thanks to @pancelor for showing how palettes (which use color 133) can shave a byte in tweetjam-mode by replacing with ˇ - both of these glyphs mean "color 133" when used in a palette-string, but unlike other p8-emoji-glyphs, twitter only counts ˇ as a single byte, instead of two!