Hi.
Idea: change bockground and foreground color in sg.Input element with .Update() method, by adding 2 key-word parameters bg and fg.
All
3
Latest
_____( 汀掳 蜏蕱 汀掳)____ Python programming experience
_____( 汀掳 蜏蕱 汀掳)____ Programming experience overall
_____yes____ Have used another Python GUI Framework (tkiner, Qt, etc) previously (yes/no is fine)?
import PySimpleGUI as sg, random
window = sg.Window('Test this', [
[sg.I(key='-name-', change_submits=True)]
])
while True:
event, values = window.read()
if event in (None, 'Exit'): break
if event == '-name-':
bg_color = random.choice(['white', 'orange', 'green'])
fg_color = random.choice(['red', 'pink', 'blue'])
window['-name-'].update(bg=bg_color,
fg=fg_color)
window.close()
__docstring__ (two params's guys) def Update(self, value=None, disabled=None, select=None, visible=None, move_cursor_to='end', bg=None, fg=None):
"""
Changes some of the settings for the Input Element. Must call `Window.Read` or `Window.Finalize` prior
:param value: (str) new text to display as default text in Input field
:param disabled: (bool) disable or enable state of the element (sets Entry Widget to readonly or normal)
:param select: (bool) if True, then the text will be selected
:param visible: (bool) change visibility of element
:param move_cursor_to: Union[int, str] Moves the cursor to a particular offset. Defaults to 'end'
:param bg: (str) color of background text
:param fg: (str) color of foreground text
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
return
if bg != None:
self.TKEntry.configure(background=bg)
if fg != None:
self.TKEntry.configure(foreground=fg)
if disabled is True:
self.TKEntry['state'] = 'readonly'
elif disabled is False:
self.TKEntry['state'] = 'normal'
if value is not None:
try:
self.TKStringVar.set(value)
except:
pass
self.DefaultText = value
if move_cursor_to == 'end':
self.TKEntry.icursor(tk.END)
elif move_cursor_to is not None:
self.TKEntry.icursor(move_cursor_to)
if select:
self.TKEntry.select_range(0, 'end')
if visible is False:
self.TKEntry.pack_forget()
elif visible is True:
self.TKEntry.pack()

The Multiline Element has parameters for changing the background and the text color. Rather than fg and bg, terms used by tkinter, I used text_color and background_color in the multiline Update method.
Here is that definition:
def Update(self, value=None, disabled=None, append=False, font=None, text_color=None, background_color=None, visible=None, autoscroll=None):
The code from that update looks essentially the same as what's proposed above, which is an excellent confirmation that we're on the same page 馃憤馃憤
if background_color is not None:
self.TKText.configure(background=background_color)
if text_color is not None:
self.TKText.configure(fg=text_color)
And, WOW you file amazing Issues! Animated GIF?? Are you kidding me?
Since this is such an easy change, I'll drop it in and pop it up on GitHub.
I updated the source code - it works good!

Most helpful comment
The
MultilineElement has parameters for changing the background and the text color. Rather thanfgandbg, terms used by tkinter, I usedtext_colorandbackground_colorin the multilineUpdatemethod.Here is that definition:
The code from that update looks essentially the same as what's proposed above, which is an excellent confirmation that we're on the same page 馃憤馃憤
And, WOW you file amazing Issues! Animated GIF?? Are you kidding me?
Since this is such an easy change, I'll drop it in and pop it up on GitHub.