Support rgbgfx -c dmg to imply -c dmg=e4

Fixes #1776
This commit is contained in:
Rangi42
2025-08-05 14:18:25 -04:00
parent 504a45a4ed
commit a3983b7b0f
5 changed files with 21 additions and 3 deletions

View File

@@ -322,6 +322,9 @@ static char *parseArgv(int argc, char *argv[]) {
options.palSpecType = Options::EMBEDDED;
} else if (strcasecmp(musl_optarg, "auto") == 0) {
options.palSpecType = Options::NO_SPEC;
} else if (strcasecmp(musl_optarg, "dmg") == 0) {
options.palSpecType = Options::DMG;
parseDmgPalSpec(0xE4); // Same darkest-first order as `sortGrayscale`
} else if (strncasecmp(musl_optarg, "dmg=", literal_strlen("dmg=")) == 0) {
options.palSpecType = Options::DMG;
parseDmgPalSpec(&musl_optarg[literal_strlen("dmg=")]);