export function convertJsStyle()

in src/themes/themeTools.ts [72:143]


export function convertJsStyle(name: string, theme: Theme): Theme {
  const result = {
    name,
    // 分类色阶
    category_12: [
      theme['widgets-color-category-1'],
      theme['widgets-color-category-2'],
      theme['widgets-color-category-3'],
      theme['widgets-color-category-4'],
      theme['widgets-color-category-5'],
      theme['widgets-color-category-6'],
      theme['widgets-color-category-7'],
      theme['widgets-color-category-8'],
      theme['widgets-color-category-9'],
      theme['widgets-color-category-10'],
      theme['widgets-color-category-11'],
      theme['widgets-color-category-12'],
    ],
    // 分类色阶 - 20色
    category_20: [
      theme['widgets-color-category-1'],
      theme['widgets-color-category-2'],
      theme['widgets-color-category-3'],
      theme['widgets-color-category-4'],
      theme['widgets-color-category-5'],
      theme['widgets-color-category-6'],
      theme['widgets-color-category-7'],
      theme['widgets-color-category-8'],
      theme['widgets-color-category-9'],
      theme['widgets-color-category-10'],
      theme['widgets-color-category-11'],
      theme['widgets-color-category-12'],
      theme['widgets-color-category-13'],
      theme['widgets-color-category-14'],
      theme['widgets-color-category-15'],
      theme['widgets-color-category-16'],
      theme['widgets-color-category-17'],
      theme['widgets-color-category-18'],
      theme['widgets-color-category-19'],
      theme['widgets-color-category-20'],
    ],
    // 连续色阶,比较接近的颜色会错开
    linear_10: [
      theme['widgets-color-linear-1'],
      theme['widgets-color-linear-5'],
      theme['widgets-color-linear-9'],
      theme['widgets-color-linear-3'],
      theme['widgets-color-linear-7'],
      theme['widgets-color-linear-10'],
      theme['widgets-color-linear-2'],
      theme['widgets-color-linear-4'],
      theme['widgets-color-linear-6'],
      theme['widgets-color-linear-8'],
    ],
    // 顺序色阶,连续相似的颜色排列
    order_10: [
      theme['widgets-color-linear-1'],
      theme['widgets-color-linear-2'],
      theme['widgets-color-linear-3'],
      theme['widgets-color-linear-4'],
      theme['widgets-color-linear-5'],
      theme['widgets-color-linear-6'],
      theme['widgets-color-linear-7'],
      theme['widgets-color-linear-8'],
      theme['widgets-color-linear-9'],
      theme['widgets-color-linear-10'],
    ],
  };
  Object.assign(result, theme);

  return result;
}