Studio Theme API using deprecated settings function?


#1

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()?


"settings()" is apparently deprecated, so what should I use?
#2

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.


#3

I hear recently they made the StudioWidgets repo work for dark theme, so whatever that’s using is probably canonical.


#4

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):


#5

The StudioWidgets library is using settings(). That exact library is actually what spawned me writing this thread.


#6

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.


#7

I’ll look into why settings() is marked as deprecated. It’s not actually deprecated.


#8

Bump: This is still marked as deprecated. My Script Analysis window is not happy about it


#9

Try it now


#10

Nice, it’s fixed. Thanks!