Support foreground and background colors that differ from the color palette #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Color schemes like PowerShell and Vintage have background and foreground colors that are different from ConsoleColor.Black and ConsoleColor.Gray colors, respectively. Code assuming these colors match the palette results in the wrong color being used during rendering. For navigation (especially when scrolling up or down) this can cause tearing as the correct background is used to clear the screen, then the incorrect color from the palette is used to render the line.
This change uses nullable ConsoleColor throughout the view and line renderers, where null implies reset the background or foreground color, and an explicit ConsoleColor.Black or ConsoleColor.Gray is used to use that color palette index. Also switched the Vt100 code to use the color palette index instead of the hard-coded RGB values. Full theme customization as described in #50 is a much larger change, and supporting the users color palette in that system would still be desirable. The added benefit is that if the color palette changes the app doesn't need to be restarted to pick up the change.
Before:
After: