Change the background color in WebStorm - webstorm

I have a theme installed. I just want to make the background darker than what it is, it really helps especially because I have vision problems. I guess I need to use the "Color scheme" from options, but I really couldn't find anything to change the background.

To change the background color of the Editor tab, do the following:
File | Settings (WebStorm | Preferences on macOS)
Editor | Color Scheme | General
Make a copy of the Color Scheme (if it's a bundled one or provided by a plugin) so that you can customize it (although the IDE should do that for you automatically)
Locate Text | Default text entry and change the background color there.
An example: modified Dacrula theme with bright yellow background (yeah, looks completely unusable, but good for illustration purposes):
Please note: some languages can provide own background colors. E.g. PHP -- a typical PHP-code only file will have all code inside a single <?php tag so you may see a different background color for PHP code compared to other languages. Test and adjust it as needed.
Note #2: GUI Theme (which is about styling the rest of the IDE GUI): it always linked to some Color Scheme (so the GUI and Editor area have similar colors). When you will be switching between GUI Themes make sure to double check the applied Color Scheme as well (if you need to use your custom one).
Useful shortcut: View | Quick Switch Scheme -- it will bring a popup menu that allows quickly switching different themes and schemes.

Related

how to change apache superset's chart's background color?

Per How to Change Apache Superset Template from the Superset User Interface? , I was able to change the CSS template for Superset dashboard. But the charts inside the dashboard are not affected. e.g. most of the charts have white colored background(e.g. Piechart) and some people dislike it. How to change the chart background color? I mean change it for all charts or for one chart.
Disclaimer: This should work, but is a bit hacky and could have long-term support implications:
I've been fiddling with a "dark mode" dashboard just to kick the tires on this. Here's a screenshot just for fun:
So... what did I do?
Click "Edit Dashboard" in the top right of your screenshot
When in edit mode, the top right menu has an option to "Edit CSS"
Use your browser's inspector to hack away! That said, here are a couple of key ingredients:
.dashboard-component{ background: whatever} - sets the main background of each viz card, but you'll still see many components still have white backgrounds within these wrappers.
.slice_container svg{
background-color: transparent !important;
} - this overrides the white background of the components I ran into (including Pie charts!).
If viz components use SVG you can get pretty clever with inspecting/overriding various bits. A couple of gotchas with the above:
If a viz component contains multiple SVG elements, this may have side effects.
If a viz uses canvas instead of svg you will run into more trouble
In the worst case scenario, you may need to check out the superset-ui-plugins repo and make tweaks. This dev process isn't super straightforward, but some of us are working to improve that.
Easiest solution for me is using dark reader extension.

Don't know how to change text colors in VS

Ok so basically I'm trying to change the color theme of the text editor for the code. I write in c++ and I saw a "palette" online that I really like : The colors I would like to apply somehow
But my text isn't like that and when I write comments it's green which I really don't like. Like this: The colors on my text editor
You can change the display colours (as well as fonts, sizes and many other characteristics) via the Options command from the Tools menu.
Select/Expand the Environment node in the left-hand panel of the displayed dialog box, then select Fonts and Colors. It should look something like this:
You can select colours for individual C/C++ syntax elements. by scrolling through the list in the Display Items list (there are quite a number of them).
Note: This is the system for Visual Studio 2019; other versions may be slightly different, but the general principle should hold true.
Alternatively, you may like to try the Visual Studio Color Theme Designer - but I don't use this and haven't tested it.

QProgressBar : Change color while keeping OS style

I know that Qt uses by default the OS style for decorating a QProgressBar.
I am wondering if there is a way to change the color of a QProgressBar while keeping the OS style.
I tried several methods as showned below.
Changing the palette:
QPalette palette = myProgressBar->palette();
palette.setBrush(QPalette::Highlight, someColor); // setColor() did the same
myProgressBar->setPalette(palette);
Changing directly the style:
QPalette palette = myProgressBar->palette();
palette.setBrush(QPalette::Highlight, someColor); // setColor() did the same
myProgressBar->style()->polish(palette);
But both methods was completely ignored and nothing has changed.
The only way I found to change the color of the QProgressBar is by setting a style sheet via setStyleSheet(). The problem is that it ignores the OS style at the same time.
I think it is possible to approximately replicate the OS style in a style sheet but I don't know if it is possible to directly apply the OS style and only change the color palette.
I would be very grateful for any helpful answer.
EDIT: The OS is not fixed. I am trying to make it work under Windows but the application may/will run under another OS (some Linux distribution).
It depends on which style you are using. In general Qt specific themes (like fusion) can be easily customized simply by changing the palette (Note that different styles may use different palette roles).
However, for OS specific styles (like QWindowsVistaStyle), you simply cannot do it.
The reason is that the style implementation ignores the palette and use colors from the OS theme.
For instance if you look at the implementation at QWindowsXPStyle you will find calls to GetThemeColor() which returns the color from the OS.
These OS specific styles also cannot use stylesheets correctly, that's why if yo use a stylesheet, the widget will fallback to a default style.
I believe your only solution would be to use QProxyStyle, but you may have to rewrite the code to draw parts of widget you want to customize.

How to recognize that an application is running in dark theme on Linux?

I've developed an application which uses qscintilla as a text editor. I also implemented custom lexer to highlight language specific keywords. So far styles for highlighted keywords are hardcoded in mine application and it looks quite ok in the default theme on Windows/Linux(Ubuntu)/Mac.
The problems appears when user chooses a dark theme (on Linux). Depending on QScintilla version some parts of editor do reflect current theme colors while other don't. Moreover mine custom styles render dark blue letters on dark grey background.
I'm looking for some Qt class, which will allow me access of the current system theme. I do not want to define styles for mine application widgets.
I want to know what is system default non-proportional font, what is it's size, color, ... If I knew that dark scheme is used I would choose complementary colors for keyword highlighting.
I checked docs for QStyle, QPlatformTheme and other qt classes and it seems to me that these serve more for defining of new styles, then for describing the current style.
For the system colours, you can use the group/role of the QPalette class.
For the system fonts, you can create a QFont using e.g. "Serif", "Sans Serif", "Monospace", etc with an appropriate style hint to discover the defaults.
NB:
From the Qt Docs:
Warning: Some styles do not use the palette for all drawing, for
instance, if they make use of native theme engines. This is the case
for both the Windows Vista and the macOS styles.
Here is some python code using QPalette that works for me on Linux:
label = QLabel("am I in the dark?")
text_hsv_value = label.palette().color(QPalette.WindowText).value()
bg_hsv_value = label.palette().color(QPalette.Background).value()
dark_theme_found = text_hsv_value > bg_hsv_value

How to change button color?

I am developing a GUI application using Embarcadero VCL c++ IDE for windows OS. As part of this project, I have to change color of button with respect to an external state.
I understood that windows32 API will not allow to change the color of button.
Could you please suggest me, how to change button color?
Do you wish to change the background-colour of the button, or the text-colour of it?
Since windows has used visual themes for some time now, if you have commctrl loaded and include a manifest file, the button will be drawn using the default (current) theme.
Options I can see include (a) custom-drawing the background (b) changing the text-colour in the normal draw process (c) drawing the button without a theme (i.e drawing a 'flat' button).
You could simply draw a bitmap-button, changing the bitmap depending on the state of the button. You could also use a single bitmap, tinting it using the HSL or HSV colour-space, depending on the state.
As for the flat type of button, I think you can probably change it's background-colour in much the same way as you can change the colour of the text - by intervening during the standard draw process and changing the colour from 3D_FACE (or whatever it is, I forget) to whatever you'd like.
If you look at the calculator included with windows XP, you can see an example of changing the text colour.
CodeProject.com likely has a stack of articles that would help in this endeavour. :)