Handling Dark and Light Theme Support in Autodesk Inventor Add-ins

Introduction

As modern CAD environments continue to evolve, visual consistency and interface readability have become essential for delivering an optimal user experience. Autodesk Inventor — one of the leading 3D design and engineering platforms — introduced a Dark Theme starting with Inventor 2021 as a preview feature, and expanded it in subsequent releases such as Inventor 2022, 2023, and beyond.

For developers building Inventor Add-ins, this evolution introduced a new challenge:
How do we ensure that custom dialogs, forms, and icons remain clear, readable, and professional across both Light and Dark UI themes?

In this article, we’ll explore:

  • The evolution of Dark and Light themes in Inventor
  • Design principles for theme-aware Add-ins
  • Detecting the active theme programmatically
  • Implementing adaptive UI logic in C#
  • Managing icons and ensuring consistent visual appearance

Special courtesy to Yamarah (Freeradical, Japan) for early community research and examples.
Original reference: https://qiita.com/yamarah/items/b1153186bccb15f68177


Background: The Arrival of Dark Theme in Inventor

The Dark Theme was first introduced in Autodesk Inventor 2021 as a preview option available via:

Tools → Application Options → Colors → UI Theme

However, the initial version was only partially implemented. Certain UI areas — including custom Add-in dialogs — didn’t fully follow the dark visual scheme, leading to inconsistent contrast or readability issues.

By Inventor 2022, Autodesk had significantly expanded theme coverage and introduced internal APIs such as:

  • ThemeManager
  • AppearanceManager

This allowed developers to reliably detect the active UI theme and adapt Add-in visuals accordingly. With these improvements, it became possible to build professional, polished, theme-aware Add-ins that blend seamlessly with Inventor’s interface.


Why Support Multiple Themes?

Supporting both Dark and Light themes in your Autodesk Inventor Add-in ensures that your UI remains consistent and user-friendly under different working conditions.

Key benefits:

  • Maintains visual harmony with Inventor’s interface
  • Reduces eye strain during long modeling sessions
  • Enhances usability in bright or low-light environments
  • Conveys professional quality and care in software design

Whether your users prefer the crisp clarity of Light Theme or the reduced glare of Dark Theme, theme-aware Add-ins help deliver the best possible experience.


Design Considerations for Theme-Aware Add-ins

When preparing your Add-in UI for dual-theme compatibility, consider these best practices:

  1. Detect the user’s currently active theme programmatically.
  2. Avoid hard-coded colors — rely on dynamic color palettes.
  3. Use icons with transparency, or provide separate Light/Dark versions.
  4. Ensure text and control visibility in both modes.
  5. Test your Add-in after switching themes in Inventor settings.

These principles help ensure that your Add-ins feel native and visually consistent.


Detecting the Active Theme via API

Autodesk Inventor exposes the current UI theme through the AppearanceManager or ThemeManager.

C# Example – Reading the Active Theme

string colorScheme = inventorApp.AppearanceManager.ActiveColorScheme.DisplayName;

This typically returns a scheme name like:

  • “Dark Theme”
  • “Light Theme”

Based on this result, developers can dynamically adjust UI colors or swap icon sets in real-time.


Full Implementation Example (C#)

Below is a complete example showing how to detect the active theme and automatically apply corresponding UI styling in a WinForms-based Inventor Add-in dialog.

using Inventor;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace InventorThemeAwareAddIn
{
    public partial class ThemeAwareForm : Form
    {
        private Inventor.Application _invApp;

        public ThemeAwareForm(Inventor.Application inventorApp)
        {
            InitializeComponent();
            _invApp = inventorApp;
            ApplyTheme();
        }

        private void ApplyTheme()
        {
            try
            {
                string colorScheme = _invApp.AppearanceManager.ActiveColorScheme.DisplayName;

                if (colorScheme.Contains("Dark", StringComparison.OrdinalIgnoreCase))
                    ApplyDarkTheme();
                else
                    ApplyLightTheme();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Unable to determine theme: {ex.Message}");
            }
        }

        private void ApplyDarkTheme()
        {
            this.BackColor = Color.FromArgb(45, 45, 48);
            this.ForeColor = Color.WhiteSmoke;

            foreach (Control ctrl in this.Controls)
            {
                ctrl.BackColor = this.BackColor;
                ctrl.ForeColor = this.ForeColor;
            }
        }

        private void ApplyLightTheme()
        {
            this.BackColor = Color.White;
            this.ForeColor = Color.Black;

            foreach (Control ctrl in this.Controls)
            {
                ctrl.BackColor = this.BackColor;
                ctrl.ForeColor = this.ForeColor;
            }
        }
    }
}

Explanation

  • The active theme is detected using AppearanceManager.ActiveColorScheme.DisplayName.
  • If it contains “Dark,” the form applies dark colors; otherwise light colors.
  • Both BackColor and ForeColor are propagated to all child controls.
  • The logic can be extended to cover buttons, list views, panels, tabs, and custom controls.

Managing Ribbon Icons and Transparency

Icons play a critical role in UI clarity. Inventor’s ribbon uses semi-transparent PNGs with anti-aliasing, which can look incorrect in Dark Mode if your icons include baked-in light backgrounds.

Recommended Approach:

  • Prepare two icon sets
    • Light Theme (dark strokes)
    • Dark Theme (light strokes)
  • Use transparent PNGs
  • Dynamically swap icons depending on the theme

Example — Switching Icons

private void UpdateIcons(string theme)
{
    if (theme.Contains("Dark"))
    {
        myButton.StandardIcon = LoadIcon("Resources/Icon_Dark_16.png");
        myButton.LargeIcon = LoadIcon("Resources/Icon_Dark_32.png");
    }
    else
    {
        myButton.StandardIcon = LoadIcon("Resources/Icon_Light_16.png");
        myButton.LargeIcon = LoadIcon("Resources/Icon_Light_32.png");
    }
}

This method ensures that your toolbar buttons maintain sharp contrast and look professional in both theme modes.


Testing Recommendations

To ensure your Add-in behaves correctly across both Light and Dark themes:

  1. Switch between themes:
    Application Options → Colors → UI Theme
  2. Restart Inventor (required to fully apply the change).
  3. Open your Add-in’s dialogs, palettes, and ribbon commands.
  4. Verify:
    • Text and background colors have proper contrast
    • Icons remain clear and crisp
    • Hover states and visual accents display correctly

Testing both themes ensures a polished and predictable user experience.


Conclusion

Supporting Dark and Light themes in Autodesk Inventor Add-ins is now a key requirement for delivering modern, user-friendly engineering software. By using theme detection, adaptive color logic, and theme-aware icons, developers can:

  • Build a visually consistent experience
  • Reduce visual strain for users
  • Ensure their Add-ins feel native to Inventor
  • Future-proof their tools as UI customization continues to evolve

Theme-aware Add-ins demonstrate professionalism, attention to detail, and a commitment to usability — all essential qualities for high-quality engineering applications.


References


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading