GithubHelp home page GithubHelp logo

Comments (9)

scotty007 avatar scotty007 commented on July 22, 2024 1

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.

lenormf avatar lenormf commented on July 22, 2024

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.

Glench avatar Glench commented on July 22, 2024

@swistakm is there any word on this?

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

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.

alexispurslane avatar alexispurslane commented on July 22, 2024

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.

swistakm avatar swistakm commented on July 22, 2024

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.

swistakm avatar swistakm commented on July 22, 2024

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.

swistakm avatar swistakm commented on July 22, 2024

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.

Crunchyrocks avatar Crunchyrocks commented on July 22, 2024

How to make check boxes red? same with drop downs? and other toggles , and other buttons?

from pyimgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.