import { isUndefined } from "lodash-es";
import React from "react";
import { useMapConfig } from "./use-map-config.js";
import { ColorScaleContext } from "../contexts/color-scale.context.js";
import {
  isSequentialLegend,
  isThresholdLegend
} from "../functions/build-scale-from-legend-config.js";
function useColorScale() {
  const context = React.useContext(ColorScaleContext);
  const { legend } = useMapConfig();
  if (isUndefined(legend) || isUndefined(context)) {
    return void 0;
  }
  if (isSequentialLegend(legend)) {
    return context;
  } else if (isThresholdLegend(legend)) {
    return context;
  } else {
    return context;
  }
}
export {
  useColorScale
};
//# sourceMappingURL=use-color-scale.js.map
