Comments (9)
Easy thing, just override colors in the active style as @ChristopherDumas suggested:
style = imgui.get_style() # override active style
imgui.style_colors_dark(style) # optional: set base colors from "Dark" (or any other) style
# set red, green, blue and alpha color components for style colors you wanna change
style.colors[imgui.COLOR_BORDER] = (r, g, b, a)
style.colors[imgui.COLOR_TITLE_BACKGROUND] = (r, g, b, a)
style.colors[imgui.COLOR_TITLE_BACKGROUND_ACTIVE] = (r, g, b, a)
...
from pyimgui.
As far as I could tell, the array of colors isn't bound to, so it doesn't seem to be possible (yet).
I'd like to have that feature though!
from pyimgui.
@swistakm is there any word on this?
from pyimgui.
I didn’t researched that yet. Core library definitely allows for that but I don’t know if it’s through it’s API or through some INI file. I’m right now on vacation so I can’t check it by myself. Of course any help and PRs would be really appreciated if someone want to contribute the support for themes.
from pyimgui.
As far as I understand, ImGUI uses the GetStyle function to return a style object. Then you modify that object (for changing colors there is a colors array property on the object). Alternately, you can use the PushStyleColor function to directly change the color of a particular element in the colors array. So to get this working in pyimgui we'd need to either implement get_style or push_style_color functions. I think. I'd be willing to try doing this, since I really want this functionality for something I'm working on too.
from pyimgui.
Contribution in that matter would be highly appreciated :). I would gladly review a PR.
Also, most of the pieces to get this working are already there. There is already GuiStyle
class in core.pyx
file that wraps the ImGuiStyle
class and there are functions to modify individual style/color variables. Individual functions work but changes to the global style object (obtained with imgui.get_style()
) unfortunately don't seem to propagate. This should work already but clearly something is missing. Would be great if someone could investigate this.
Also documentation is missing.
from pyimgui.
OK. It seems I've found the issue behind GuiStyle classes. There is #112 PR where this is fixed.
So this will be working in next (1.0.0) release. The only thing we need is proper theming documentation.
from pyimgui.
I have changed the tittle of this issue to Document how to change imgui theme as this is now only matter of proper documentation. I am also changing the milestone of this issue.
from pyimgui.
How to make check boxes red? same with drop downs? and other toggles , and other buttons?
from pyimgui.
Related Issues (20)
- -- deleted --
- Doesn't expose ImGuiStyle::ScaleAllSizes HOT 1
- Showing input text without a label HOT 1
- Documentation left side nav not scrollable
- Can't use it and i don't know why.
- "Game Insert"
- type stubs for pyimgui HOT 4
- None of the custom renderers change mouse cursor HOT 4
- default theme font HOT 4
- Loading SVGs as viewport/texture HOT 2
- [Bug}: When using pyimgui some users of my program have `GLError`s HOT 8
- Imgui port to pygame do not suport colaboration with programable opengl pipline
- Windows: Failed building wheel for imgui (from VsDevShell) HOT 5
- Example not working HOT 1
- pyimgui equivalent of ImGuiKey_NamedKey_END HOT 1
- Overflow error when using opengl, doublebuf and fullscreen HOT 1
- ImGui crashing when using OpenGL context 3.2+ even though GPU and driver support 4.6
- Upgrading dear imgui version beyond 1.82 HOT 6
- Anyone studied if F3D is able to render on pyimgui HOT 4
- I have a problem when i trying to use imgui[glfw] io.fonts.get_glyph_ranges_chinese_full() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyimgui.