Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Background Color #148

Closed
stevozilik opened this issue Nov 15, 2018 · 8 comments
Closed

Change Background Color #148

stevozilik opened this issue Nov 15, 2018 · 8 comments

Comments

@stevozilik
Copy link

Any way to change background color from blue to something else?
I've tried setting ColorScheme on everything I can see and no luck...

Regards,
Stefan

@migueldeicaza
Copy link
Collaborator

How did you set the color scheme?

@tayabsoomro
Copy link

Has anyone figured this out yet?

@shiftybit
Copy link

From what @migueldeicaza has asked, I would gather that it's possible to set the Color Scheme, but I can't find out in the documentation how to do it.

Can we get some guidance on that?

@PioArchiver
Copy link

I found the following in CursesDriver.cs

I could use any information regarding how to implement it properly.
Also found this and a bunch of other color theme methods in the above named file.

public override void SetColors (ConsoleColor foreground, ConsoleColor background)

Maybe their is an issue with #84 for cross platform compat.

I saw these too #61, #29, and #48 too

@PioArchiver
Copy link

PioArchiver commented Mar 14, 2019

Hi @migueldeicaza was wondering if I should put up an issue for guidance about the last commit you did to expose the MakeColor part of the curses API?

@Benjamintf1
Copy link

Benjamintf1 commented Apr 25, 2019

That's rather confusing. I'd assume that SetColors() or SetAttribute to set the background colors, but I was only able to set the colors by manually setting Terminal.gui.Colors.Base and editing the application.Driver didn't seem to do anything.

Specificially the line to change the blue is

using Terminal.Gui;
...
            Application.Init();
            Colors.Base = Colors.Dialog;

I'mt testing this on windows.

@migueldeicaza
Copy link
Collaborator

There are a number of ways of changing the color.

The first thing is to configure the ColorScheme, which defines all the global colors after you have called Application.Init:

Application.Init ();
Colors.Base.Normal = Application.Driver.MakeAttribute (Color.Green, Color.Black);

The other one is to set the ColorScheme on a specific view, here I just change it to the error one, but you can create your own:

var win = new Window (...)
win.ColorScheme = Colors.Error;

@Benjamintf1
Copy link

Solid, TY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants