mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Logo (Chafa): accept enum strings instead of numbers
This commit is contained in:
+28
-3
@@ -189,11 +189,36 @@ logoType:
|
||||
else if(strcasecmp(subKey, "symbols") == 0)
|
||||
ffOptionParseString(key, value, &options->chafaSymbols);
|
||||
else if(strcasecmp(subKey, "canvas-mode") == 0)
|
||||
options->chafaCanvasMode = ffOptionParseUInt32(key, value);
|
||||
{
|
||||
options->chafaCanvasMode = (uint32_t) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
|
||||
{ "TRUECOLOR", 0 },
|
||||
{ "INDEXED_256", 1 },
|
||||
{ "INDEXED_240", 2 },
|
||||
{ "INDEXED_16", 3 },
|
||||
{ "FGBG_BGFG", 4 },
|
||||
{ "FGBG", 5 },
|
||||
{ "INDEXED_8", 6 },
|
||||
{ "INDEXED_16_8", 7 },
|
||||
{},
|
||||
});
|
||||
}
|
||||
else if(strcasecmp(subKey, "color-space") == 0)
|
||||
options->chafaColorSpace = ffOptionParseUInt32(key, value);
|
||||
{
|
||||
options->chafaColorSpace = (uint32_t) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
|
||||
{ "RGB", 0 },
|
||||
{ "DIN99D", 1 },
|
||||
{},
|
||||
});
|
||||
}
|
||||
else if(strcasecmp(subKey, "dither-mode") == 0)
|
||||
options->chafaDitherMode = ffOptionParseUInt32(key, value);
|
||||
{
|
||||
options->chafaDitherMode = (uint32_t) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
|
||||
{ "NONE", 0 },
|
||||
{ "ORDERED", 1 },
|
||||
{ "DIFFUSION", 2 },
|
||||
{},
|
||||
});
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user