It was stated that settings().Studio["UI Theme"] would break eventually and intentionally. So after some searching, I found that the Studio object in settings has some new methods like Studio:FindTheme; however, that page gives the following example:
local StudioTheme = settings().Studio:FindTheme(“Dark”)
My confusion here is that settings() is marked as deprecated…so I’m confused why this seems to be the supported way to grab the theme.
Am I missing something? Is there another way to access the Studio object without going through settings()?
I think they are planning to release a more proper API for getting individual colors of a theme and theme management. I personally wouldn’t spend time into any of this until they confirm publicly which are final and which are not.
The API mentioned is the new, proper API. It’s currently live on production without needing to manually enable any flags, so I think this is close enough to the final version that where the API lives (settings()) isn’t changing. @OP: Just ignore the deprecated warning for now, and you should be able to use the new API without worrying about it significantly changing since it’s already live.
BTW, to make determining which theme style/state to use, here is a handy chart (click to expand – Discourse embedding is broken and does not show full image):
Will do. I guess I’ll just grab the Studio instance in one place for my plugin and share it, that way I can easily swap out the settings() piece of the code with whatever is provided in the future.