MCPcopy Create free account
hub / github.com/microsoft/SandDance / getSemanticColors

Function getSemanticColors

docs/app/js/sanddance-app.js:27773–27893  ·  view source on GitHub ↗
(p, e, s, isInverted, depComments)

Source from the content-addressed store, hash-verified

27771 return _fixDeprecatedSlots(fullSemanticColors, depComments);
27772}
27773function getSemanticColors(p, e, s, isInverted, depComments) {
27774 if (depComments === void 0) depComments = false;
27775 var _a, _b, _c;
27776 var result = {};
27777 // map palette
27778 var _d = p || {}, white = _d.white, black = _d.black, themePrimary = _d.themePrimary, themeDark = _d.themeDark, themeDarker = _d.themeDarker, themeDarkAlt = _d.themeDarkAlt, themeLighter = _d.themeLighter, neutralLight = _d.neutralLight, neutralLighter = _d.neutralLighter, neutralDark = _d.neutralDark, neutralQuaternary = _d.neutralQuaternary, neutralQuaternaryAlt = _d.neutralQuaternaryAlt, neutralPrimary = _d.neutralPrimary, neutralSecondary = _d.neutralSecondary, neutralSecondaryAlt = _d.neutralSecondaryAlt, neutralTertiary = _d.neutralTertiary, neutralTertiaryAlt = _d.neutralTertiaryAlt, neutralLighterAlt = _d.neutralLighterAlt, accent = _d.accent;
27779 if (white) {
27780 result.bodyBackground = white;
27781 result.bodyFrameBackground = white;
27782 result.accentButtonText = white;
27783 result.buttonBackground = white;
27784 result.primaryButtonText = white;
27785 result.primaryButtonTextHovered = white;
27786 result.primaryButtonTextPressed = white;
27787 result.inputBackground = white;
27788 result.inputForegroundChecked = white;
27789 result.listBackground = white;
27790 result.menuBackground = white;
27791 result.cardStandoutBackground = white;
27792 }
27793 if (black) {
27794 result.bodyTextChecked = black;
27795 result.buttonTextCheckedHovered = black;
27796 }
27797 if (themePrimary) {
27798 result.link = themePrimary;
27799 result.primaryButtonBackground = themePrimary;
27800 result.inputBackgroundChecked = themePrimary;
27801 result.inputIcon = themePrimary;
27802 result.inputFocusBorderAlt = themePrimary;
27803 result.menuIcon = themePrimary;
27804 result.menuHeader = themePrimary;
27805 result.accentButtonBackground = themePrimary;
27806 }
27807 if (themeDark) {
27808 result.primaryButtonBackgroundPressed = themeDark;
27809 result.inputBackgroundCheckedHovered = themeDark;
27810 result.inputIconHovered = themeDark;
27811 }
27812 if (themeDarker) result.linkHovered = themeDarker;
27813 if (themeDarkAlt) result.primaryButtonBackgroundHovered = themeDarkAlt;
27814 if (themeLighter) result.inputPlaceholderBackgroundChecked = themeLighter;
27815 if (neutralLight) {
27816 result.bodyBackgroundChecked = neutralLight;
27817 result.bodyFrameDivider = neutralLight;
27818 result.bodyDivider = neutralLight;
27819 result.variantBorder = neutralLight;
27820 result.buttonBackgroundCheckedHovered = neutralLight;
27821 result.buttonBackgroundPressed = neutralLight;
27822 result.listItemBackgroundChecked = neutralLight;
27823 result.listHeaderBackgroundPressed = neutralLight;
27824 result.menuItemBackgroundPressed = neutralLight;
27825 // eslint-disable-next-line deprecation/deprecation
27826 result.menuItemBackgroundChecked = neutralLight;
27827 }
27828 if (neutralLighter) {
27829 result.bodyBackgroundHovered = neutralLighter;
27830 result.buttonBackgroundHovered = neutralLighter;

Callers 1

makeSemanticColorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected