Fossil SCM
Add the "raw-bgcolor" setting, defaulting to "off" but if turned "on" disables the background color filter.
Commit
f23d9ab878f2c4b66a003216f8291df97fbe2e238f471ae92a1725caa1e8efb8
Parent
a390c6ba5a32d18…
1 file changed
+19
-4
+19
-4
| --- src/color.c | ||
| +++ src/color.c | ||
| @@ -213,10 +213,20 @@ | ||
| 213 | 213 | } |
| 214 | 214 | return -1; |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | +/* | |
| 219 | +** SETTING: raw-bgcolor boolean default=off | |
| 220 | +** | |
| 221 | +** Fossil usually tries to adjust user-specified background colors | |
| 222 | +** for checkins so that the text is readable and so that the color | |
| 223 | +** is not too garish. This setting disables that filter. When | |
| 224 | +** this setting is on, the user-selected background colors are shown | |
| 225 | +** exactly as requested. | |
| 226 | +*/ | |
| 227 | + | |
| 218 | 228 | /* |
| 219 | 229 | ** Shift a color provided by the user so that it is suitable |
| 220 | 230 | ** for use as a background color in the current skin. |
| 221 | 231 | ** |
| 222 | 232 | ** The return value is a #HHHHHH color name contained in |
| @@ -226,27 +236,32 @@ | ||
| 226 | 236 | ** that is the input, then return NULL. |
| 227 | 237 | ** |
| 228 | 238 | ** The iFgClr parameter is normally 0. But for testing purposes, set |
| 229 | 239 | ** it to 1 for a black foregrounds and 2 for a white foreground. |
| 230 | 240 | */ |
| 231 | -char *reasonable_bg_color(const char *zRequested, int iFgClr){ | |
| 241 | +const char *reasonable_bg_color(const char *zRequested, int iFgClr){ | |
| 232 | 242 | int iRGB = color_name_to_rgb(zRequested); |
| 233 | 243 | int cc[3]; |
| 234 | 244 | int lo, hi; |
| 235 | 245 | int r, g, b; |
| 236 | 246 | static int systemFg = 0; /* 1==black-foreground 2==white-foreground */ |
| 237 | - int fg; | |
| 238 | - static char zColor[10]; | |
| 247 | + int fg; /* Foreground color to actually use */ | |
| 248 | + static char zColor[10]; /* Return value */ | |
| 239 | 249 | int K = 70; /* Tune for background color saturation */ |
| 240 | 250 | |
| 241 | 251 | if( iFgClr ){ |
| 242 | 252 | fg = iFgClr; |
| 243 | 253 | }else if( systemFg==0 ){ |
| 244 | - fg = systemFg = skin_detail_boolean("white-foreground") ? 2 : 1; | |
| 254 | + if( db_get_boolean("raw-bgcolor",0) ){ | |
| 255 | + fg = systemFg = 3; | |
| 256 | + }else{ | |
| 257 | + fg = systemFg = skin_detail_boolean("white-foreground") ? 2 : 1; | |
| 258 | + } | |
| 245 | 259 | }else{ |
| 246 | 260 | fg = systemFg; |
| 247 | 261 | } |
| 262 | + if( fg>=3 ) return zRequested; | |
| 248 | 263 | |
| 249 | 264 | if( iRGB<0 ) return 0; |
| 250 | 265 | if( fg==0 ) fg = skin_detail_boolean("white-foreground") ? 2 : 1; |
| 251 | 266 | cc[0] = (iRGB>>16) & 0xff; |
| 252 | 267 | cc[1] = (iRGB>>8) & 0xff; |
| 253 | 268 |
| --- src/color.c | |
| +++ src/color.c | |
| @@ -213,10 +213,20 @@ | |
| 213 | } |
| 214 | return -1; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /* |
| 219 | ** Shift a color provided by the user so that it is suitable |
| 220 | ** for use as a background color in the current skin. |
| 221 | ** |
| 222 | ** The return value is a #HHHHHH color name contained in |
| @@ -226,27 +236,32 @@ | |
| 226 | ** that is the input, then return NULL. |
| 227 | ** |
| 228 | ** The iFgClr parameter is normally 0. But for testing purposes, set |
| 229 | ** it to 1 for a black foregrounds and 2 for a white foreground. |
| 230 | */ |
| 231 | char *reasonable_bg_color(const char *zRequested, int iFgClr){ |
| 232 | int iRGB = color_name_to_rgb(zRequested); |
| 233 | int cc[3]; |
| 234 | int lo, hi; |
| 235 | int r, g, b; |
| 236 | static int systemFg = 0; /* 1==black-foreground 2==white-foreground */ |
| 237 | int fg; |
| 238 | static char zColor[10]; |
| 239 | int K = 70; /* Tune for background color saturation */ |
| 240 | |
| 241 | if( iFgClr ){ |
| 242 | fg = iFgClr; |
| 243 | }else if( systemFg==0 ){ |
| 244 | fg = systemFg = skin_detail_boolean("white-foreground") ? 2 : 1; |
| 245 | }else{ |
| 246 | fg = systemFg; |
| 247 | } |
| 248 | |
| 249 | if( iRGB<0 ) return 0; |
| 250 | if( fg==0 ) fg = skin_detail_boolean("white-foreground") ? 2 : 1; |
| 251 | cc[0] = (iRGB>>16) & 0xff; |
| 252 | cc[1] = (iRGB>>8) & 0xff; |
| 253 |
| --- src/color.c | |
| +++ src/color.c | |
| @@ -213,10 +213,20 @@ | |
| 213 | } |
| 214 | return -1; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /* |
| 219 | ** SETTING: raw-bgcolor boolean default=off |
| 220 | ** |
| 221 | ** Fossil usually tries to adjust user-specified background colors |
| 222 | ** for checkins so that the text is readable and so that the color |
| 223 | ** is not too garish. This setting disables that filter. When |
| 224 | ** this setting is on, the user-selected background colors are shown |
| 225 | ** exactly as requested. |
| 226 | */ |
| 227 | |
| 228 | /* |
| 229 | ** Shift a color provided by the user so that it is suitable |
| 230 | ** for use as a background color in the current skin. |
| 231 | ** |
| 232 | ** The return value is a #HHHHHH color name contained in |
| @@ -226,27 +236,32 @@ | |
| 236 | ** that is the input, then return NULL. |
| 237 | ** |
| 238 | ** The iFgClr parameter is normally 0. But for testing purposes, set |
| 239 | ** it to 1 for a black foregrounds and 2 for a white foreground. |
| 240 | */ |
| 241 | const char *reasonable_bg_color(const char *zRequested, int iFgClr){ |
| 242 | int iRGB = color_name_to_rgb(zRequested); |
| 243 | int cc[3]; |
| 244 | int lo, hi; |
| 245 | int r, g, b; |
| 246 | static int systemFg = 0; /* 1==black-foreground 2==white-foreground */ |
| 247 | int fg; /* Foreground color to actually use */ |
| 248 | static char zColor[10]; /* Return value */ |
| 249 | int K = 70; /* Tune for background color saturation */ |
| 250 | |
| 251 | if( iFgClr ){ |
| 252 | fg = iFgClr; |
| 253 | }else if( systemFg==0 ){ |
| 254 | if( db_get_boolean("raw-bgcolor",0) ){ |
| 255 | fg = systemFg = 3; |
| 256 | }else{ |
| 257 | fg = systemFg = skin_detail_boolean("white-foreground") ? 2 : 1; |
| 258 | } |
| 259 | }else{ |
| 260 | fg = systemFg; |
| 261 | } |
| 262 | if( fg>=3 ) return zRequested; |
| 263 | |
| 264 | if( iRGB<0 ) return 0; |
| 265 | if( fg==0 ) fg = skin_detail_boolean("white-foreground") ? 2 : 1; |
| 266 | cc[0] = (iRGB>>16) & 0xff; |
| 267 | cc[1] = (iRGB>>8) & 0xff; |
| 268 |