const colorModeStyle = {
dark: {
// Text color
text: {
emphasis: 'colors.white:emphasis',
primary: 'colors.white:primary',
secondary: 'colors.white:secondary',
tertiary: 'colors.white:tertiary',
disabled: 'colors.white:disabled',
link: 'colors.blue:40',
success: 'colors.green:40',
info: 'colors.blue:50',
warning: 'colors.orange:50',
error: 'colors.red:50',
},
// Shadow color
// Note: The shadow style props will be removed from `styled-ui-theme`.
shadow: {
sm: '0 2px 8px 0 rgba(0, 0, 0, 0.48), 0 1px 2px 0 rgba(0, 0, 0, 0.16)',
md: '0 4px 16px 0 rgba(0, 0, 0, 0.48), 0 2px 4px 0 rgba(0, 0, 0, 0.16)',
lg: '0 8px 32px 0 rgba(0, 0, 0, 0.48), 0 4px 8px 0 rgba(0, 0, 0, 0.16)',
},
// Severity color: critical, high, medium, low, none
severity: {
critical: 'colors.red:50',
high: 'colors.red:50',
medium: 'colors.orange:50',
low: 'colors.yellow:50',
none: 'colors.gray:50',
},
// Chart color scheme
// https://docs.appian.com/suite/help/20.2/Chart_Color_Scheme.html
chart: {
classic: {
0: 'colors.gray:50',
1: 'colors.blue:50',
2: 'colors.green:40',
3: 'colors.orange:50',
4: 'colors.cyan:40',
5: 'colors.red:50',
6: 'colors.purple:50',
7: 'colors.teal:40',
8: 'colors.magenta:40',
9: 'colors.green:30',
10: 'colors.yellow:50',
},
},
},
light: {
// Text color
text: {
emphasis: 'colors.black:emphasis',
primary: 'colors.black:primary',
secondary: 'colors.black:secondary',
tertiary: 'colors.black:tertiary',
disabled: 'colors.black:disabled',
link: 'colors.blue:60',
success: 'colors.green:50',
info: 'colors.blue:60',
warning: 'colors.orange:50',
error: 'colors.red:60',
},
// Shadow color
// Note: The shadow style props will be removed from `styled-ui-theme`.
shadow: {
sm: '0 2px 8px 0 rgba(0, 0, 0, 0.16), 0 1px 2px 0 rgba(0, 0, 0, 0.08)',
md: '0 4px 16px 0 rgba(0, 0, 0, 0.16), 0 2px 4px 0 rgba(0, 0, 0, 0.08)',
lg: '0 8px 32px 0 rgba(0, 0, 0, 0.16), 0 4px 8px 0 rgba(0, 0, 0, 0.08)',
},
// Severity color: critical, high, medium, low, none
severity: {
critical: 'colors.red:60',
high: 'colors.red:60',
medium: 'colors.orange:50',
low: 'colors.yellow:50',
none: 'colors.gray:50',
},
// Chart color scheme
// https://docs.appian.com/suite/help/20.2/Chart_Color_Scheme.html
chart: {
classic: {
0: 'colors.gray:50',
1: 'colors.blue:60',
2: 'colors.green:50',
3: 'colors.orange:50',
4: 'colors.cyan:40',
5: 'colors.red:60',
6: 'colors.purple:60',
7: 'colors.teal:40',
8: 'colors.magenta:50',
9: 'colors.green:30',
10: 'colors.yellow:50',
},
},
},
};
const {
colorMode,
colorModeStyle, // or colorStyle
setColorMode,
toggleColorMode,
} = useColorMode();
const primartText = colorModeStyle.get('text.primary');
// => 'rgba(255, 255, 255, .92)' (= `get(theme, 'colors.white:primary')`)
const disabledText = colorModeStyle.get('text.disabled');
// => 'rgba(255, 255, 255, .28)' (= `get(theme, 'colors.white:disabled')`)
const smallShadow = colorModeStyle.get('shadow.sm');
// => '0 2px 8px 0 rgba(0, 0, 0, 0.48), 0 1px 2px 0 rgba(0, 0, 0, 0.16)'