File size: 608 Bytes
b0e0325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st

# Function to change text color based on user input
def change_text_color(text, color):
    # Apply HTML styling to change text color
    styled_text = f'<span style="color:{color};">{text}</span>'
    return styled_text

# Streamlit app
st.title("Text Color Changer")

# Input text and color selection
user_text = st.text_input("Enter your text:")
selected_color = st.selectbox("Select text color:", ["red", "blue", "green", "orange"])

# Apply text color change and display
styled_text = change_text_color(user_text, selected_color)
st.markdown(styled_text, unsafe_allow_html=True)