@function each($hue-rotate-config) {
  @each $key, $hue-rotate in $hue-rotate-config {
    $hue-rotate-config: map.set(
      $hue-rotate-config,
      $key,
      (
        --bs-hue-rotate: hue-rotate($hue-rotate),
      )
    );
  }
  @return $hue-rotate-config;
}

@function each-negative-hue-rotate($hue-rotate-config) {
  @each $key, $hue-rotate in $hue-rotate-config {
    $hue-rotate-config: map.set($hue-rotate-config, $key, -$hue-rotate);
  }
  @return $hue-rotate-config;
}

$utilities: map-merge(
  $utilities,
  (
    "hue-rotate": (
      property: --bs-hue-rotate,
      class: hue-rotate,
      variants: hue-rotate,
      values: each($hue-rotate-config),
    ),
    "negative-hue-rotate": (
      property: --bs-hue-rotate,
      class: -hue-rotate,
      variants: hue-rotate,
      values: each(each-negative-hue-rotate($hue-rotate-config)),
    ),
  )
);
