import { forwardRef } from 'react';
import getColor from "../../../utils/colors/getColor.js";
const withColor = function withColor(C) {
  const Component = forwardRef((props, ref) => {
    const {
      color,
      ...restProps
    } = props;
    return <C ref={ref} color={getColor(color)} {...restProps} />;
  });
  Component.displayName = `WithColor(${C.displayName})`;
  return Component;
};
export default withColor;