Closed TWry closed 4 years ago
Thanks for trying v2!
Looks like I had set the default to Color.LightGrey
(#D3D3D3
) instead of Color.White
for one reason or another.
Right now this is a constant in the BetterConsole.Core
library and can't be changed by the user, though it could be configured through a static property.
The API for this would be:
BetterConsole.Core.Constants.UserDefinedDefaultForegroundColor = Color.Magenta;
This will give preference to your defined color over the constant.
Note that this only affects text, table borders/dividers are not colored at this time.
This will be available in BetterConsole.Core
v1.1.0
which will be available once Nuget indexes it.
https://www.nuget.org/packages/BetterConsole.Core/1.1.0
This changes the default color to White
, as well as adds the ability to override that default.
Excellent, many thanks for accommodating my request! Will try this as soon as Nuget found the new version.
It seems something is wrong. I'm getting the following exception now:
Unhandled exception. System.MissingFieldException: Field not found: 'BetterConsole.Core.Constants.DefaultForegroundColor'. at BetterConsole.Colors.Format..ctor() at BetterConsoleTables.Models.CellFormat..ctor() at BetterConsoleTables.Models.CellFormat.Default() at BetterConsoleTables.Models.Column..ctor(String columnTitle, ICellFormat headerFormat, ICellFormat rowsFormat) at BetterConsoleTables.Builders.ColumnBuilder..ctor(String columnTitle) at ConsoleApp1.Program.PrintTableSchemas(OracleConnection con) in /Users/twry/RiderProjects/ConsoleApp1/ConsoleApp1/Program.cs:line 54 at ConsoleApp1.Program.Main(String[] args) in /Users/twry/RiderProjects/ConsoleApp1/ConsoleApp1/Program.cs:line 21
Well that's unexpected, do you have a code snippet that causes this?
Oh, I see the issue. Since I changed this from a field to a property the build BetterConsole.Colors DLL is referencing a field still, so I need to push a rebuilt BetterConsole.Colors version
BetterConsole.Colors
v1.0.1 has been published as well as BetterConsoleTables v2.0.1-beta1
, please upgrade these packages when able.
Done, all working now, thanks!
Closing as this appears to be resolved.
Is there a way to change the default text color in version 2? After transitioning from v1 to v2, all table text was colored gray. I know that you can change it by using ColumnBuilder but it seems overly verbose to have to change it for each and every column for both the column header and rows. # #