Is it possible to add a color picker?

Can I get something like this on a page? Or any other color picker?
Using 3 rgb-sliders is less comfortable. Any ideas?

Hi @Concubine, welcome to the forums !

There is no way to interactive selection on a 2D plane for now, this looks like a perfect use case for a simple Streamlit plugin when Plugin architecture is in place.

In the meantime, you may be able to hack this a little bit, as there is a ColorPicker in Bokeh

import streamlit as st
from bokeh.models.widgets import ColorPicker

color_picker = ColorPicker(color="#ff4466", title="Choose color:", width=200)
st.bokeh_chart(color_picker)

… maybe you could pass the value of the color picker back to your Python code using a hidden st.text_box using the cool Custom Widgets Hack - Login,

(well it may be a bit more involved, I can’t find the value of the selected color on the HTML page and could not get the Bokeh JS callbacks to update an input in Streamlit to work in 5 minutes of reading the doc :confused: …I may try again later :slight_smile:)

1 Like

Color picker is now native in Streamlit : st.beta_color_picker