Omnibus commited on
Commit
4163d83
1 Parent(s): cd134be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,7 +28,7 @@ css="""
28
  }
29
  .chat_card{
30
  background: #253251; #background_c
31
- color:#ffffff; #font_c
32
  border-radius: 15px;
33
  border-width: thin;
34
  padding: 15px;
@@ -71,7 +71,7 @@ def make_filename(inp):
71
  def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
72
  print(user_c)
73
  if user_c:
74
- html_user=css.replace("background: #367bb9; #user_c",f"background: {user_c};")
75
  html_body=""
76
  for user,bot in chat:
77
  html_body += html_user.replace("$chat",user)
@@ -149,7 +149,7 @@ with gr.Blocks(css=css) as app:
149
  bot_c=gr.ColorPicker(value="#1c3c9b")
150
  with gr.Row():
151
  background_c=gr.ColorPicker(value="#253251")
152
- font_c=gr.ColorPicker(value="#ffffff")
153
  chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True)
154
 
155
  im_btn=gr.Button("Screenshot")
 
28
  }
29
  .chat_card{
30
  background: #253251; #background_c
31
+ color:#FFFFFF; #font_c
32
  border-radius: 15px;
33
  border-width: thin;
34
  padding: 15px;
 
71
  def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
72
  print(user_c)
73
  if user_c:
74
+ html_user=css.replace("background: #367bb9; #user_c",f"background: {user_c.strip('""')};")
75
  html_body=""
76
  for user,bot in chat:
77
  html_body += html_user.replace("$chat",user)
 
149
  bot_c=gr.ColorPicker(value="#1c3c9b")
150
  with gr.Row():
151
  background_c=gr.ColorPicker(value="#253251")
152
+ font_c=gr.ColorPicker(value="#FFFFFF")
153
  chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True)
154
 
155
  im_btn=gr.Button("Screenshot")