I'm attempting to create a loop that gradually decreases the lightness value of hsla over a set number of iterations. However, when I execute the loop, I encounter an error stating
$lightness: "96.77419" is not a number for
hsla'`. Can someone please help me identify where I've made a mistake and suggest improvements?
Code
$iterations: 31;
$base: 100;
$math: $base / $iterations;
li {
background: #919190;
height: 40px;
line-height: 40px;
color: #191919;
text-align: center;
}
@for $i from 1 through $iterations {
.options:nth-of-type(#{$i}) {
background: hsla(60, 1, #{($base - $math)}, 1);
}
Codepen Example: http://codepen.io/styler/pen/BHwjc
Sassmeister Demo:
My goal is to create a gradual increase in color to generate a shade palette. I am looking to utilize this process multiple times with different parameters. Any additional advice on optimizing this would be greatly appreciated.