The streamlit color picker is very neat, but sometimes it’s overkill. For one, the user has to click on the box to see the entire color palette. Then to select a color they have a continuous range to pick from, which may overwhelm the user. Thirdly, finalizing a color selection involves clicking on the board and then clicking outside the widget area.
I want to have a simple selection menu, with just a few discrete color values that a user can see and choose one from by clicking on a color (visualized below)
Please adjust my example code as needed for your purpose e.g. colors inside HTML.
You can change red, green, blue and yellow to your hex colors as needed.
Additionally you can store the chosen color in e.g. a session state and use that for your graph color or other app-elements as needed.