function getBackgroundColor()

in src/checkbox/styled-components.ts [64:106]


function getBackgroundColor(props) {
  const { $disabled, $checked, $isIndeterminate, $error, $isHovered, $isActive, $theme } = props;
  const { colors } = $theme;
  if ($disabled) {
    if ($checked || $isIndeterminate) {
      return colors.tickFillDisabled;
    } else {
      return colors.tickFill;
    }
  } else if ($error && ($isIndeterminate || $checked)) {
    if ($isActive) {
      return colors.tickFillErrorSelectedHoverActive;
    } else if ($isHovered) {
      return colors.tickFillErrorSelectedHover;
    } else {
      return colors.tickFillErrorSelected;
    }
  } else if ($error) {
    if ($isActive) {
      return colors.tickFillErrorHoverActive;
    } else if ($isHovered) {
      return colors.tickFillErrorHover;
    } else {
      return colors.tickFillError;
    }
  } else if ($isIndeterminate || $checked) {
    if ($isActive) {
      return colors.tickFillSelectedHoverActive;
    } else if ($isHovered) {
      return colors.tickFillSelectedHover;
    } else {
      return colors.tickFillSelected;
    }
  } else {
    if ($isActive) {
      return colors.tickFillActive;
    } else if ($isHovered) {
      return colors.tickFillHover;
    } else {
      return colors.tickFill;
    }
  }
}