Palette JSON Sorter User Guide
Palette JSON Sorter interface preview

Green Macaroni User Guide

Palette JSON Sorter

A browser-based companion to Palette Grabber for reorganizing, renaming, correcting and cleaning palette JSON files without rebuilding the colors from scratch.

Quick start

Most jobs take less than a minute once the palette is loaded.

1Load the JSON palettePress Load JSON… or B. Palette JSON Sorter reads the file and turns its colors into editable swatch rows.
2Choose a useful orderSort alphabetically, by the first number in each name, by Hue/Lightness naming, or arrange the actual colors as a spectrum.
3Fine-tune manuallyDrag rows by the dotted handle, use the ▲/▼ buttons, rename a swatch, or double-click its color chip to correct the color itself.
4Export the cleaned resultChoose Export JSON for reuse in Palette Grabber, or Export HTML Table for a printable color reference.
The app does not invent a new palette. Its main job is to organize the palette you already have, while still giving you tools to correct names and individual colors when needed.

Where Palette JSON Sorter fits in Green Macaroni

Palette JSON Sorter is the housekeeping companion to Palette Grabber.

Photo / artworkPalette GrabberPalette JSON SorterPalette Grabber

Palette Grabber creates and stores reusable color palettes. When a palette grows large, or when its colors need a more useful sequence, export the palette as JSON and open it here.

Palette JSON Sorter lets you reorganize those swatches without manually recreating their color values. Export the cleaned JSON and bring it back into Palette Grabber, where the palette can return to your wider Green Macaroni color workflow.

Swatches and palettes

Two color terms make the whole workflow easier to understand.

SwatchOne saved color sample. A swatch normally has a color value and may also have a useful name.
PaletteA group of swatches that belong together, such as colors sampled from one photograph, a brand system, a painting, or a project.

Palette JSON Sorter mostly works at the swatch level. It changes the order, names and individual color values inside one loaded palette.

Loading palette JSON

The parser accepts several practical JSON structures instead of requiring one exact file shape.

Accepted structureWhat Palette JSON Sorter does
Flat swatch arrayAccepts a JSON array such as [{...}, {...}] and treats each object as one swatch.
Palette Grabber formatAccepts an object containing name and a swatches array, preserving the palette name for editing and export.
Alternative array keysAlso recognizes swatch arrays stored under colors, colours, palette or items.

What a swatch needs

The parser prefers a swatch's hex value when present, but it can also build HEX from numeric r, g and b values. If a swatch has no explicit name, it can use a Pantone field as a name, or fall back to a simple Color 1, Color 2 sequence.

Malformed JSON cannot be guessed safely. If the file contains broken JSON syntax or no recognizable swatch array, the app stops and reports the problem rather than silently rewriting the file.

The swatch list

Every loaded color becomes one visual row with its name, actual color and digital values.

PartWhat it does
Dotted handleGrab ⋮⋮ to drag the row to a new position. Dragging is armed only from the handle so normal text editing is not accidentally turned into a drag.
Color chipShows the current color. Double-click it to open the Color Mixer & Namer.
Name fieldEdit the swatch name directly. Press Enter to finish the text edit.
HEX / RGB lineDisplays the normalized color as HEX plus rgb(r, g, b).
▲ / ▼Nudge a swatch up or down one row at a time. This is also a useful alternative to dragging on touch devices.

Clicking or tapping a row selects it visually. Reordering changes the palette's current order immediately, and the JSON Code view stays synchronized unless you are in the middle of manually editing that code.

Sorting and arranging swatches

The app provides four different ideas of “order,” because useful color order depends on how the palette was named and how you intend to use it.

SortBehavior
A → ZSorts swatch names alphabetically, case-insensitively.
Z → ASorts swatch names in reverse alphabetical order.
Low → HighFinds the first number inside each swatch name and sorts numerically. Names with no number move after the numbered names.
High → LowThe same first-number sort in descending order.
Hue → LightnessReads structured names such as Hue 90 • L40, sorts by Hue first and then Lightness. Names that do not match the pattern are left after matching swatches.
Arrange as SpectrumUses the swatches' actual RGB colors, not their names. Colored swatches sweep by hue, then lightness; low-saturation neutrals are placed at the end.
Reset to originalRestores the row order from the JSON as it was originally loaded.
Sort first, fine-tune second. A fast workflow is to use the closest automatic sort, then drag or nudge the few colors that you want positioned differently.

Color Mixer & Namer

Double-click a swatch's color chip when the color itself needs correcting, not just its position.

ControlPurpose
HEXType a six-digit HEX color directly.
Color pickerUse the browser's native color picker to choose a replacement color visually.
HueMoves around the color wheel from 0 to 360 degrees.
SatAdjusts saturation from muted/grey to intense color.
LightAdjusts lightness from dark to light.
NameGive the corrected swatch any descriptive name you want.
Auto-nameWhen enabled, builds a structured name such as Hue 90 • L40 from the current HSL color. Those names work naturally with the Hue → Lightness sort.
Copy HEXCopies the current HEX value to the clipboard.
Apply to swatchWrites the new RGB, HEX and optional name back into the selected swatch.

Before the mixer opens, the app stores one state snapshot. Press Z after a mixer edit to restore that snapshot.

Undo is intentionally narrow. The current Z shortcut is for the most recent mixer-based change. It is not a universal undo for sorting, dragging or renaming.

Palette name

A loaded palette can be given a human-readable name before export.

If the source is already a Palette Grabber-style object with name and swatches, the name field edits that palette name. If the source is a plain flat array, the field still becomes available after load.

Flat array conversion: giving a flat-array file a palette name changes its JSON export into the Palette Grabber-style { name, swatches: [...] } format. Leave the palette name blank if you specifically need to keep a flat-array export shape.

Named JSON exports also receive a friendlier filename derived from the palette name, with unsafe filename characters removed.

JSON Code view

The visual list and the raw JSON are two views of the same current palette.

Open the JSON Code tab to inspect the exact JSON that the app is prepared to export. You can also edit it directly.

CommandUse it when
Apply JSON to listYou intentionally edited the raw JSON and want the visual swatch list rebuilt from those changes. The same parser rules used for file loading apply here.
Reset JSON to current stateYou changed the code but want to discard those un-applied edits and regenerate the code from the current visual list.
Apply is a rebuild. Applying code replaces the current visual swatch state with whatever the JSON contains and establishes that as the new original order for Reset to original.

Export JSON

The exporter tries to preserve the useful structure of the file you loaded while updating the swatches you changed.

SourceExport behavior
Flat array, no palette nameKeeps the flat-array shape. Existing swatch fields are preserved where possible, while current name, HEX and RGB values are written back.
Flat array, palette name suppliedExports a Palette Grabber-style object with name plus a swatches array containing each swatch's name and RGB values.
Palette object with swatchesPreserves the original object and existing swatch fields where possible, while updating the palette name, order, name, HEX and RGB values.

The output is formatted JSON with two-space indentation, making it readable both by software and by a person who needs to inspect the data.

Export HTML Table

Create a standalone color reference that can be opened in a browser, printed or saved as a PDF through the browser's print dialog.

OptionChoices
ColumnsAuto responsive, or a fixed 2, 3, 4, 5 or 6 columns.
Chip sizeSmall, Medium or Large.
Font sizeSmall, Medium or Large.

Each exported card contains the swatch name, HEX value and RGB values. The color chips are inline SVG rectangles rather than fragile CSS-only color blocks, which helps browser print dialogs render them cleanly.

The exported page includes the generation date/time and the total swatch count. It is self-contained, so it can be archived with a project or sent to someone who does not have Palette JSON Sorter open.

Color Theory Basics

The built-in help panel explains the three HSL ideas used by the sorter and mixer.

Hue (H)The basic color family around the wheel. The app describes hue from 0 through 360 degrees, with red at the wrap point.
Lightness (L)How dark or light the color is, from black at L0 to white at L100.
Saturation (S)How intense or muted a color is. Lower saturation is dustier/greyer; higher saturation is more vivid.
Hue/Lightness namingNames such as Hue 90 • L40 turn those color properties into sortable labels, making orderly shade ladders easy to rebuild.

Open Color Theory Basics from the app footer whenever you want the short in-app refresher.

Mobile and smaller screens

The same palette tools remain available when the interface collapses to a narrower layout.

  • Below the desktop two-panel width, the Options/JSON panel moves above the swatch list rather than squeezing both columns.
  • The header controls wrap on phones so Load and export commands remain reachable.
  • The Color Mixer becomes a one-column layout on very narrow screens.
  • For precise reordering on touch devices, the ▲ and ▼ row buttons are often easier than drag-and-drop.
  • Because the input is a JSON file rather than a photograph, the app does not need camera access.

Your palette files stay in the browser

Palette JSON Sorter reads and writes the working palette locally.

Load JSON… uses the browser's local file reader. The current build parses the selected text in the page rather than uploading the palette file to a Green Macaroni server.

JSON and HTML exports are generated in the browser as downloadable files. Nothing in the current palette-editing workflow requires an account, sign-in or server-side storage.

Local file readingLocal editingJSON outputHTML output

Keyboard and control shortcuts

The current build keeps the global shortcuts deliberately small so text editing remains predictable.

ControlAction
BOpen Load JSON.
CClear the current palette and return the app to its unloaded state.
ZUndo the most recent mixer-based change if a mixer snapshot is available.
EnterFinish editing a swatch name field and remove focus from the field.
EscClose the Color Theory Basics modal when it is open.
Double-click color chipOpen the Color Mixer & Namer for that swatch.
Drag dotted handleMove a swatch to a new position in the list.
▲ / ▼Move a swatch one position up or down.

Global B, C and Z shortcuts are ignored while you are typing in an input or textarea, so they do not interfere with swatch names or raw JSON editing.

Troubleshooting

Most problems come from the source JSON shape, the distinction between name-based sorts and color-based sorting, or the difference between visual and raw-code edits.

The file will not load

Make sure it is valid JSON and that it contains either an array of swatches, an object with a swatches array, or one of the supported alternative array keys: colors, colours, palette or items.

Numeric sorting looks strange

The sorter uses the first number found in each swatch name. Check the names if the number you intended to sort by is not the first numeric value.

Hue → Lightness does not affect some rows

That sort reads structured names such as Hue 90 • L40. Swatches without a matching Hue/L pattern are placed after the swatches that do match.

I want the actual colors arranged visually, regardless of their names

Use Arrange as Spectrum. It derives hue, saturation and lightness from the swatches' RGB data and places neutral colors at the end.

I changed the JSON Code but the list did not change

Raw code edits are intentionally not live. Press Apply JSON to list when you are ready to rebuild the visual palette from the edited JSON.

I want to abandon my raw JSON edits

Press Reset JSON to current state. That regenerates the editor from the current visual list.

Z did not undo my sort or drag

The current undo stores only the snapshot created before a Color Mixer edit. Use Reset to original to recover the original loaded order, or apply another sort to reorganize the list.

My flat-array export became a Palette Grabber palette object

That happens when you give a flat-array source a palette name. Clear the palette name before export if you specifically want to preserve the flat-array shape.

I need a paper or PDF color reference

Use Export HTML Table, open the downloaded HTML file in your browser, then print it or choose your browser's Save as PDF option.

Back to Top