Error with sass - Argument `$color` of `darken($color, $amount)` must be a color


I’ve moved my colour variables into the $colors map within css/variables/colors.

For the most part this works fine when i reference i.e. color(primary) in my styles, however if I try to use the varaible in a sass function i.e. lighten(primary,10%) I get the above error.

The issue only seems to occur when I use these variables within these functions. Even if I try to reassign to a new variable (i.e. $primary: colors(primary)) the error persists.

Would I be better off using map-get() instead? For reference the value of the variable is just a standard hex value

Thanks in advance!

Lol, turned out I wasn’t including the color functions file, woops!!!

Consider this closed, thanks!!