Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting custom color palettes based on user profile color for all paletted graphics #2137

Merged
merged 7 commits into from
Jan 6, 2023

Conversation

DieGo367
Copy link
Contributor

@DieGo367 DieGo367 commented Jan 6, 2023

What's changed?

For each image, you may define a set of color palettes for each possible user profile color. These take the form of .bin files in the new palettes folder. They work like boxart and custom banners; box.bin will apply to box.bmp. The format is very simple: each palette is 32 bytes long (16 colors with 2 bytes each). These use the same color codes as in theme.ini. The palettes are stored one after another, in order of the profile colors (Grey-Blue, Brown, Red, Pink, Orange, Yellow, Lime, Green, Dark Green, Turquoise, Light Blue, Blue, Dark Blue, Violet, Purple, Magenta). This means each palette file is 512 bytes. It should be straightforward enough to create these with any hex editor or even online tools such as hexed.it, although it's certainly very tedious.

There is one extra palette file that doesn't apply to an image. username.bin will apply to the username when UsernameUserPalette is enabled. This one is also a special case in that each palette is only 4 colors, so the file should only be 128 bytes.

I've made an example skin based on the DSi light theme that simply tints the box textures in the user's color.
image

Even just recoloring this one texture and creating the palette file proved to be a lot of trouble so ideally there'd be a tool to help with creating them, but I haven't made anything like that yet.

The files in the palettes folder won't apply to a particular image unless its UserPalette option is enabled. Otherwise, they fallback to the built in palette. A few specific textures have a different fallback palette then the rest, they are noted in the table below. Here is the updated list of UserPalette options:

Option name DSi Default 3DS Default Note
BipsUserPalette false
BoxUserPalette false
BoxEmptyUserPalette false
BoxFullUserPalette false
BraceUserPalette false
BubbleUserPalette false false
ButtonArrowUserPalette true
CornerButtonUserPalette false
CursorUserPalette false false Shares control with StartBorderUserPalette because their textures load in the same place. Uses a unique fallback palette because of this.
DialogBoxUserPalette true false
FolderUserPalette false false
LaunchDotsUserPalette true
MovingArrowUserPalette true
ProgressUserPalette true true
ScrollWindowUserPalette false
SmallCartUserPalette false false
StartBorderUserPalette true false Uses a unique fallback palette. Shares control with CursorUserPalette because their textures load in the same place.
StartTextUserPalette true Uses a unique fallback palette.
WirelessIconsUserPalette false false
IconA26UserPalette false false
IconCOLUserPalette false false
IconGBUserPalette false false
IconGBAUserPalette false false
IconGBAModeUserPalette false false
IconGGUserPalette false false
IconIMGUserPalette false false
IconINTUserPalette false false
IconM5UserPalette false false
IconManualUserPalette false false
IconMDUserPalette false false
IconNESUserPalette false false
IconNGPUserPalette false false
IconPCEUserPalette false false
IconPLGUserPalette false false
IconSettingsUserPalette false false
IconSGUserPalette false false
IconSMSUserPalette false false
IconSNESUserPalette false false
IconUnknownUserPalette false false
IconWSUserPalette false false
UsernameUserPalette true true Not an image, refers to the coloring of the username text.
ProgressBarPalette true true Not an image, refers to the coloring of the loading screen progress bar.

Where have you tested it?

melonDS 0.9.5
DSi with Unlaunch


Pull Request status

  • This PR has been tested using the latest version of devkitARM and libnds.

@spellboundtriangle
Copy link
Contributor

Even just recoloring this one texture and creating the palette file proved to be a lot of trouble so ideally there'd be a tool to help with creating them, but I haven't made anything like that yet.

This seems like it may work well as a GIMP plugin. Would something external be better though?

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.

None yet

3 participants