Colourise text in an input field

I want to change the colour of the text in an input field conditionally.

I create my input field as follows:

date = st.text_input(label="Published Date:", key="dateInput", value=st.session_state["current_date"])

My condition is like this:

        if response['date_adjusted'] == 1:
            st.session_state.dateInput = f":orange[{response['date']}]"
            st.session_state.dateInput = f":#FAFAFA[{response['date']}]"

However this does not colourise the text in the input field and just displays it as β€œ:orange[{response[β€˜date’]}]”

How do I achieve what I want?

Best Regards,

Hi @Configentia,

Thanks for posting!

Can you please add more code snippets or share the repo link so we can help troubleshoot?