@use 'sass:color';
@use 'sass:map';

@mixin generate-color-palette($base-color, $name, $custom: null) {
    $colors: (50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900);
    $color-map: ();

    @each $value in $colors {
        $color: color.adjust($base-color, $lightness: (500 - $value) * 0.1%);
        $color-map: map.merge($color-map, ($value: $color));
    }

    @if $custom != null {
        $color-map: map.deep-merge($color-map, $custom);
    }

    @each $value, $color in $color-map {
        --#{$name}-#{$value}: #{$color};
    }
}
