66#include "util/textModifier.h"
77#include "util/stringUtils.h"
88
9- void ffPercentAppendBar (FFstrbuf * buffer , double percent , FFPercentConfig config )
9+ void ffPercentAppendBar (FFstrbuf * buffer , double percent , FFColorRangeConfig config )
1010{
1111 uint8_t green = config .green , yellow = config .yellow ;
1212 assert (green <= 100 && yellow <= 100 );
@@ -75,7 +75,7 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFPercentConfig config
7575 ffStrbufAppendS (buffer , FASTFETCH_TEXT_MODIFIER_RESET );
7676}
7777
78- void ffPercentAppendNum (FFstrbuf * buffer , double percent , FFPercentConfig config , bool parentheses )
78+ void ffPercentAppendNum (FFstrbuf * buffer , double percent , FFColorRangeConfig config , bool parentheses )
7979{
8080 uint8_t green = config .green , yellow = config .yellow ;
8181 assert (green <= 100 && yellow <= 100 );
@@ -89,9 +89,9 @@ void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFPercentConfig config
8989
9090 if (colored && !options -> pipe )
9191 {
92- const char * colorGreen = instance . config . display . percentColorGreen .chars ;
93- const char * colorYellow = instance . config . display . percentColorYellow .chars ;
94- const char * colorRed = instance . config . display . percentColorRed .chars ;
92+ const char * colorGreen = options -> percentColorGreen .chars ;
93+ const char * colorYellow = options -> percentColorYellow .chars ;
94+ const char * colorRed = options -> percentColorRed .chars ;
9595
9696 if (percent != percent )
9797 ffStrbufAppendS (buffer , "\e[" FF_COLOR_FG_LIGHT_BLACK "m" );
@@ -126,7 +126,7 @@ void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFPercentConfig config
126126 ffStrbufAppendC (buffer , ')' );
127127}
128128
129- bool ffPercentParseCommandOptions (const char * key , const char * subkey , const char * value , FFPercentConfig * config )
129+ bool ffPercentParseCommandOptions (const char * key , const char * subkey , const char * value , FFColorRangeConfig * config )
130130{
131131 if (!ffStrStartsWithIgnCase (subkey , "percent-" ))
132132 return false;
@@ -160,7 +160,7 @@ bool ffPercentParseCommandOptions(const char* key, const char* subkey, const cha
160160 return false;
161161}
162162
163- bool ffPercentParseJsonObject (const char * key , yyjson_val * value , FFPercentConfig * config )
163+ bool ffPercentParseJsonObject (const char * key , yyjson_val * value , FFColorRangeConfig * config )
164164{
165165 if (!ffStrEqualsIgnCase (key , "percent" ))
166166 return false;
@@ -198,7 +198,7 @@ bool ffPercentParseJsonObject(const char* key, yyjson_val* value, FFPercentConfi
198198 return true;
199199}
200200
201- void ffPercentGenerateJsonConfig (yyjson_mut_doc * doc , yyjson_mut_val * module , FFPercentConfig defaultConfig , FFPercentConfig config )
201+ void ffPercentGenerateJsonConfig (yyjson_mut_doc * doc , yyjson_mut_val * module , FFColorRangeConfig defaultConfig , FFColorRangeConfig config )
202202{
203203 if (config .green == defaultConfig .green && config .yellow == defaultConfig .yellow )
204204 return ;
0 commit comments