Get Current Rhino Dark/Light Theme Status/State?

Hello,

I have this code that sets the Dark/Light mode on an Eto.Button press.

    def OnDarkModeButtonClick(self, sender, e):
        self.dark_mode = sender.Checked
        if sender.Checked:
            # Rhino.RhinoApp.WriteLine("Dark Mode On")
            Rhino.ApplicationSettings.AppearanceSettings.SetToDarkMode()
        else:
            # Rhino.RhinoApp.WriteLine("Dark Mode Off")
            Rhino.ApplicationSettings.AppearanceSettings.SetToLightMode()

How do I do the reverse and set the value of self.dark_mode variable based on the current “theme color”

In other words, is there a “GetMode” that returns “Light” “Dark” or “0” or “1” or whatever so I can figure out if Rhino is currently using a dark or light theme and have my UI respond accordingly.

Thanks for your response!

This might be handy, it will style your ETO form for you.

But if you do want that “GetMode” there is always;
HostUtils.RunningInDarkMode

– cs

1 Like

Thank you @csykes !! That is what I am after!

The post you linked is very helpful and I’ve been using that for all my other forms and dialogs but for this go around I’m doing some “fancy” graphics so I’m manually controlling a bunch of stuff related to theme and other things so I do need a dedicated get function so I can set my custom graphics accordingly

1 Like