Skip to content

Palette System - #37

Merged
Ruling-0 merged 17 commits into
masterfrom
palette-system
Sep 15, 2026
Merged

Ruling-0 merged 17 commits into
masterfrom
palette-system

Conversation

@Ruling-0

Copy link
Copy Markdown
Owner

Adds an alternative system for coloring material shapes -- palettes. Original idea by @june_username in the GTNH discord.

A palette is a PNG for one or more materials, where each material has an index to some column of that PNG. A material indicates it uses a palette through a builder call, where it specifies the name of the palette and its column. Then, instead of tinting shapes, it will replace the grayscale pixels with colors from the palette (maintaining alpha from the original art). It does the replacement such that the palette column (descending) maps to the art pixels by HSV value (descending). That is, the top pixel in the column will replace the highest-value pixel, and the bottom the lowest. If there are less pixels in the column than differing HSV values, the bottom column pixel is repeatedly used as necessary.

The palette system still respects layers. The layers are flattened onto the base image before the palette is applied, blending (see PaletteBaker#compositeOver) each layer. The overlay, similar to tint, remains uncolored.

Example material added showing using a short palette column, and an animation.

@Ruling-0
Ruling-0 merged commit 6419028 into master Sep 15, 2026
1 check passed
@Ruling-0
Ruling-0 deleted the palette-system branch September 15, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant