• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Get current color theme (Dark Gray or Light)

Stats

  • Replies 6
  • Subscribers 147
  • Views 1900
  • Members are here 0

Get current color theme (Dark Gray or Light)

Aurel B
Aurel B 1 month ago

Hi All,

Since latest release, Virtuoso starts in dark theme by default.
(I get that it's nice to introduce the new features, but I find it a bit intrusive for some users.)

However, some of my interfaces had hardcoded colors which are really hard to look at in the new dark theme.

What is the proper way to determine the current color theme ("Dark Gray" or Light)?

Or (even better) is there a way to determine current theme colors (title, body, primary, secondary, accent, etc.)?

I read about "~/.cadence/ui/theme.json" but I don't have this file.

Thanks,

Aurel

  • Cancel
  • Sign in to reply
  • Andrew Beckett
    Andrew Beckett 1 month ago

    Hi Aurel,

    There's a CCR (3259072) for two new SKILL functions (the existing functions are private) to determine the current theme (color scheme) or to determine whether in dark mode. These have only relatively recently been checked in, and I don't see it integrated in the upcoming ISR4 branch, so it may be later than that. I'm trying to find out.

    Anyway, much of the time the color challenges I've seen have been if you use icons - if so, you can put a variant icon in a subdirectory "dark" under where your icons are loaded from and it will then switch to the same-named file under the dark directory when in dark mode.

    If it's for other manipulation of the UI (e.g. HTML fields that use colors), you'll probably need the new API when it arrives.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to Andrew Beckett

    Also, the theme.json file you mentioned won't exist unless you've set the preference in Options->User Preferences (i.e. if it's still at the dark mode default).

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Aurel B
    Aurel B 1 month ago in reply to Andrew Beckett

    That's unfortunate.

    But knowing there is a private function, I was able to find it, thanks! Wink

    I'll use that until a public one is released.

    Have a nice day,

    Aurel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to Aurel B

    Aurel,

    The fix is schedule for IC25.1 ISR5 (currently 17th April), and the two functions will be hiGetStyleColorScheme and hiIsInDarkColorScheme

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Aurel B
    Aurel B 1 month ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the info, it matches my findings, I will check if it is callable or fallback to the private one.

    This raises other questions : 
    - Looking at `hiGetStyleColorScheme` output, it feels like it is made to support other themes in the future (or the possibility to make custom ones). Is it the case?

    - I made dedicated CSS files for each theme, mostly to use with `hiCreateHypertextField`.
      However, I was not able to use external CSS files within HTML displayed by the field.
      My workaround is to write the CSS content inside <head><style> tags, is there a better solution for that?

    Thanks,

    Aurel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to Aurel B
    Aurel B said:
    Looking at `hiGetStyleColorScheme` output, it feels like it is made to support other themes in the future (or the possibility to make custom ones). Is it the case?

    There is an additional experimental/preliminary theme (which has higher contrast and is darker) so the idea is that this API caters for future additional refinements. However, there's no plan for custom themes (it's quite hard ensuring things look OK even with our own additional theme(s) without having to cope with custom themes which may have colours that don't work alongside text in the main UI or icons and so on).

    Aurel B said:
    However, I was not able to use external CSS files within HTML displayed by the field.
      My workaround is to write the CSS content inside <head><style> tags, is there a better solution for that?

    I'm not aware of the external CSS file support not working within the HTML - might be a Qt limitation or some security restriction (not sure why) but nobody seems to have reported it. I can't think of a better approach than you're using - if this is important to you though, I suggest  creating a support case (maybe it can be enhanced to allow external CSS files).

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information