Skip to content

Instantly share code, notes, and snippets.

@robrakaric
robrakaric / rainbow-colors.scss
Last active March 14, 2021 14:43
Sass function that takes a base color (html, rgb, or hsl) and number to calculate a rainbow color palette of colors equidistant from each other in the color spectrum
@function rainbowColors($base-color, $number-of-colors) {
$color-list: ($base-color);
$degrees: 360/$number_of_colors;
@for $i from 1 through $number_of_colors - 1 {
$color-list: append($color-list, adjust-hue($base-color, $degrees * $i), comma)
}
@return $color-list;