Hey!
I’m working on a custom notification componenet, and I would like to know how can I get the currently set colors of the theme? (to get them via the code I mean)
Hey!
I’m working on a custom notification componenet, and I would like to know how can I get the currently set colors of the theme? (to get them via the code I mean)
+1! This would be really helpful.
Hey!
Already created that
an initial version.
This sounds really cool.
When you say you already created that feature, can you provide a code snippet or any other helpful insights? I have the same question, for getting the current Theme so I can set matplotlib colors based on what the theme is. Thanks!
You can use the colors by using this:
pc = st.get_option('theme.primaryColor')
bc = st.get_option('theme.backgroundColor')
sbc = st.get_option('theme.secondaryBackgroundColor')
tc = st.get_option('theme.textColor')
If i understand right, this takes the colors ONLY if you use the external settings.
by external settings i mean creating a file names .streamlit near the app script, and input something like:
config.toml (The name of the file yo should create)
[theme]
primaryColor = "#8270b3"
backgroundColor = "#0E1117"
secondaryBackgroundColor = "#2c2c2c"
textColor = "#FAFAFA"
font = "monospace"
Also you are free to edit my custom theme, it has some cool options IMHO.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.