SebastianBravo commited on
Commit
1ce1010
·
1 Parent(s): 9b07100

Color test

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -84,7 +84,7 @@ def clear():
84
 
85
  theme = gr.themes.Base(primary_hue="teal").set(block_background_fill="#235784",)
86
 
87
- with gr.Blocks(theme="darkbase") as demo:
88
  with gr.Row():
89
  # gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233529518-33e8bcdb-146f-49e8-94c4-27d6529ce4f7.png' width="30%" height="30%"></center>""")
90
  gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233531457-f368e04b-5099-42a8-906d-6f1250ea0f1e.png' width="40%" height="40%"></center>""")
@@ -156,7 +156,12 @@ with gr.Blocks(theme="darkbase") as demo:
156
  # Cargar imagen nueva
157
  input_file.change(load_img,
158
  input_file,
159
- [original_input_sitk, original_input_img])
 
 
 
 
 
160
 
161
  # Mostrar imagen nueva
162
  load_img_button.click(show_img,
 
84
 
85
  theme = gr.themes.Base(primary_hue="teal").set(block_background_fill="#235784",)
86
 
87
+ with gr.Blocks(theme="base") as demo:
88
  with gr.Row():
89
  # gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233529518-33e8bcdb-146f-49e8-94c4-27d6529ce4f7.png' width="30%" height="30%"></center>""")
90
  gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233531457-f368e04b-5099-42a8-906d-6f1250ea0f1e.png' width="40%" height="40%"></center>""")
 
156
  # Cargar imagen nueva
157
  input_file.change(load_img,
158
  input_file,
159
+ [original_input_sitk, original_input_img], _js="""
160
+ () => {
161
+ document.body.classList.toggle('dark');
162
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
163
+ }
164
+ """)
165
 
166
  # Mostrar imagen nueva
167
  load_img_button.click(show_img,