Log In  

Cart #palette_maker-1 | 2019-09-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

A tool for creating palettes!

RUN THIS CARTRIDGE LOCALLY!

This tool exports your palette to your clipboard, which only works if you download the cartridge in the local Pico-8 Editor - to download this cartridge, run this command from the main p8 commandline:
LOAD #PALETTE_MAKER

INSTRUCTIONS:

Press X to switch between "Color Select" mode and "Color Order" mode.

In "Color Select" mode: Click a color to select/deselect it. Press Z to switch between default colors and "special dark" colors.

In "Color Order" mode: Click and drag colors to reorder them.

At any time: Paste your clipboard contents into another pico8 editor (or a text file) to export your palette as Lua. You can put this Lua in your _INIT() function, or at the very top of your script, or at whatever point you want the palette to change.

Example output:

_pal={132,4,143,15}
for i,c in pairs(_pal) do
    pal(i-1,c,1)
end
P#68190 2019-09-27 17:21 ( Edited 2019-09-27 17:31)

:: dw817

I see this is a palette re-arranger.

Pretty good, actually. Nice job on sideways text for long table. You get my star. I also think you're the first person outside of myself who ever uses the clipboard to auto-create Pico-8 source insertion or raw HTML to assist in coding for either.

In the strip view, maybe add more information like the color index 0, 1, 2, 3, at the top.

    lua=
        lua.."}"
        .."\n"
        .."for i,c in pairs(_pal) do"
        .."\n"
        .."\tpal(i-1,c,1)"
        .."\n"
        .."end"
        .."\n\n"

To leave out the dot dots and \r \n you could use this smaller version:

lua=lua..[[
for i,c in pairs(_pal)
  pal(i-1,c,1)
end]]
P#68196 2019-09-27 18:49 ( Edited 2019-09-30 17:48)

Oh yeah, labeling the color index for each strip in the ordering screen sounds nice! (Edit - that's added now)

I forgot all about the multi-line string thing, maybe related to how I was initially writing something with more appends throughout the whole thing, and then I didn't change the format when I moved all the value-insertion stuff into that _pal table.

P#68199 2019-09-27 20:46 ( Edited 2019-09-27 21:00)
:: dw817

Glad to help ! :)

Yep, those square [[ ]] brackets are a blessing. You can include the instructions for your cart right a the top using these and until you type ]] you can have anything at all - which is ALSO a string so you can just CLS()PRINT(ins) to have it appear.

Quite powerful. Sometime I need to sit and take a good look at that string insertion method and see how it could be put to great use.

P#68200 2019-09-27 21:01
1

HAHA whoa @Skulhhead1924, I didn't realize that would work!

P#68372 2019-10-02 15:03

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-03-02 20:43 | 0.034s | 4194k | Q:36