invert colors or negative

0 votes
asked Dec 30, 2011 by zuse (120 points)
edited Dec 30, 2011

Is it possible to have an negative color scheme. I am trying to set a white background, but other colors are gone when using Custom ColorScheme.

Thank

1 Answer

0 votes
answered Dec 30, 2011 by Lukas Pokorny (121,750 points)
edited Dec 30, 2011

You can define a custom palette that inverts the default colors, like this:

C#:

// declare a custom palette
var palette = new TerminalPalette();
for (int i = 0; i < 16; i++)
{
    Color c = palette.GetColor(i);
    c = Color.FromArgb(255 - c.R, 255 - c.G, 255 - c.B);
    palette.SetColor(i, c);
}

// assign the palette to TerminalControl object
terminalControl.Palette = palette;
...