API

theme configuration

// 统一设置主题 Schema, 色板,名称 
s2.setThemeCfg({ 
  theme: {}, 
  palette: {}, 
  name: "default" 
}); 
 
// 单独设置主题 Schema, 配置单元格背景,文字大小,文字颜色 
s2.setTheme({ 
  rowCell: { 
    cell: { 
      backgroundColor: "#fff" 
    } 
  } 
}); 
ThemeCfg
Palette

optional object

Function description: Table theme swatches

parameterparametertypeDefaultsrequired
brandColorSwatch theme colorstring-✓
basicColorsbase colorstring[]-✓
basicColorRelationsThe correspondence between basicColors and the subscripts of the standard color palette arrayArray<{ basicColorIndex: number; standardColorIndex: number;}>-✓
semanticColorsColors used to represent the actual business semantics. For example, the built-in color "red fall green rise"[key: string]-✓
othersColors used to represent the actual business semantics. For example, the built-in color "red fall green rise"[key: string]-
S2Theme