function getThemes(defaultOptions) {
  let themes;
  if (Blockly.registry && Blockly.registry.getAllItems('theme')) {
    // Using a version of Blockly that registers themes.
    themes = Blockly.registry.getAllItems('theme');
  } else {
    // Fall back to a pre-set list of themes.
    themes = {
      classic: Blockly.Themes.Classic,
      dark: darkTheme,
      deuteranopia: deuteranopiaTheme,
      tritanopia: themeTritanopia,
      highcontrast: highContrastTheme,
    };
    if (defaultOptions.theme) {
      themes[/** @type {!Blockly.Theme} */ (defaultOptions.theme).name] =
        defaultOptions.theme;
    }
  }
  return themes;
}
Get the list of Blockly themes.
@param {Blockly.BlocklyOptions} defaultOptions Default Blockly options.
@returns {Object<string,Blockly.Theme>} The list of registered themes.