hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.67k stars 669 forks source link

Color gradient on themes #2214

Open darwinharianto opened 8 months ago

darwinharianto commented 8 months ago

Is your feature request related to a problem? Please describe. I have been looking at color gradient lately and see how it improve user experience. I would love the same functionality on dearpygui.

Describe the solution you'd like being able to use color gradient on background color

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Image of color gradient

Screenshot 2023-11-02 at 9 57 13
v-ein commented 8 months ago

DearPyGui is built on top of Dear ImGui, which does not provide any means for gradient filling in standard UI widgets. That is, it's impossible to implement gradients in buttons, input fields, etc. in DPG.

What you can do is you can use the Drawing API to create your own widgets. If I remember correctly, there's a rectangle with gradient fill based on colors of its corners; you can also use pre-cooked textures with whatever fill you want.