hoffstadt / hoffstadt/DearPyGui
`add_file_extension` does not apply `color` when using multiple file types
- Dominant language
- C++
- Stars
- 15.6k
- Forks
- 783
- PR merge metrics
- No merged PRs in 30d
Description
## Version of Dear PyGui
DPG Version: 1.1.3
OS: macOS-10.15.7-x86_64-i386-64bit
## My Issue/Question
When using the `add_file_extension`, the color argument only appears to work if the basic single extension method is used. If multiple extensions are supplied in the form shown on the tutorial https://dearpygui.readthedocs.io/en/latest/documentation/file-directory-selector.html it does not work as expected.
```python
dpg.add_file_extension(".py", color=(0, 255, 0, 255), custom_text="[Python]") # Works applies green color
dpg.add_file_extension("Text Files (*.txt *.md *.rtf){.txt,.md,.rtf}", color=(255, 0, 0, 255)) # BUG red color does not apply to these, appear white
```
## Screenshots/Video
Text files should be colored red in below screen shot:

## Standalone, minimal, complete and verifiable example
```python
import dearpygui.dearpygui as dpg
import dearpygui
import platform
print(f"DPG Version: {dearpygui.__version__}")
print(f"OS: {platform.platform()}")
dpg.create_context()
def make_files():
files = [
'a.txt', # These should be red but appear white
'b.txt',
'a.md',
'b.md',
'a.rtf',
'a.py'
'b.py',
'a.h',
'b.h',
'a.xyz',
'b.xyz',
'c.xyz',
]
for fname in files:
with open(fname, 'w') as f:
pass
def callback(sender, app_data, user_data):
print("Sender: ", sender)
print("App Data: ", app_data)
with dpg.file_dialog(directory_selector=False, show=False, callback=callback, id="file_dialog_id"):
dpg.add_file_extension(".*", color=(255,255,0,255)) # BUG? default color does not appear to work, appear white
dpg.add_file_extension("", color=(150, 255, 150, 128))
dpg.add_file_extension("Text Files (*.txt *.md *.rtf){.txt,.md,.rtf}", color=(255, 0, 0, 255)) # BUG? red color does not apply to these, appear white
dpg.add_file_extension(".h", color=(255, 0, 255, 255), custom_text="[header]")
dpg.add_file_extension(".py", color=(0, 255, 0, 255), custom_text="[Python]")
with dpg.window(label="Tutorial", width=800, height=300):
dpg.add_button(label="Makes Sample Files", callback=make_files)
dpg.add_button(label="File Selector", callback=lambda: dpg.show_item("file_dialog_id"))
dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```
Contributor guide
Assessment
This issue has not been assessed yet.